{
  "name": "source-map-concat",
  "version": "1.0.1",
  "author": {
    "name": "Simon Lydell"
  },
  "license": "MIT",
  "description": "Concatenate files with source maps.",
  "main": "index.js",
  "files": [
    "index.js"
  ],
  "repository": {
    "type": "git",
    "url": "lydell/source-map-concat"
  },
  "keywords": [
    "source map",
    "source-map",
    "source",
    "map",
    "dummy",
    "concatenate",
    "concat",
    "cat",
    "mapcat"
  ],
  "scripts": {
    "lint": "jshint index.js test/index.js",
    "unit": "mocha",
    "test": "npm run lint && npm run unit"
  },
  "dependencies": {
    "source-map": "^0.5.3",
    "urix": "^0.1.0"
  },
  "devDependencies": {
    "mocha": "^2.4.5",
    "jshint": "^2.9.1",
    "source-map-dummy": "^1.0.0",
    "chai": "^3.5.0"
  },
  "readme": "Overview [![Build Status](https://travis-ci.org/lydell/source-map-concat.svg?branch=master)](https://travis-ci.org/lydell/source-map-concat)\n========\n\nConcatenate files with source maps.\n\n```js\nvar fs     = require(\"fs\")\nvar path   = require(\"path\")\nvar concat = require(\"source-map-concat\")\n\nvar resolveSourceMapSync = require(\"source-map-resolve\").resolveSourceMapSync\nvar createDummySourceMap = require(\"source-map-dummy\")\n\nvar jsFiles = [\"foo.js\", \"subdir/bar.js\", \"../baz.js\"]\n\njsFiles = jsFiles.map(function(file) {\n  return {\n    source:  file,\n    code: fs.readFileSync(file).toString()\n  }\n})\njsFiles.forEach(function(file) {\n  var previousMap = resolveSourceMapSync(file.code, file.source, fs.readFileSync)\n  if (previousMap) {\n    file.map = previousMap.map\n    file.sourcesRelativeTo = previousMap.sourcesRelativeTo\n  } else {\n    file.map = createDummySourceMap(file.code, {source: file.source, type: \"js\"})\n  }\n})\n\nfunction wrap(node, file) {\n  node.prepend(\"void function(){\\n// File: \" + file.source + \"\\n\")\n  node.add(\"}();\")\n}\n\nvar output = \"subdir/bundle.js\"\n\nvar concatenated = concat(jsFiles, {\n  delimiter: \"\\n\",\n  process: wrap,\n  mapPath: output + \".map\"\n})\n\nconcatenated.prepend(\"/* Bruce Banner */\\n\")\nconcatenated.add(\"\\n/* Footer */\")\n\nvar result = concatenated.toStringWithSourceMap({\n  file: path.basename(output)\n})\n\nfs.writeFileSync(output, result.code)\nfs.writeFileSync(output + \".map\", result.map.toString())\n```\n\n\nInstallation\n============\n\n`npm install source-map-concat`\n\n```js\nvar concat = require(\"source-map-concat\")\n```\n\n\nUsage\n=====\n\n### `concat(files, options)` ###\n\n`files` is an array of objects with the following properties:\n\n- `code`: The contents of the file, as a string.\n- `map`: The source map of the file, if any, as an object, a string or anything\n  with a `.toJSON()` method (such as a [`SourceMapGenerator`]). It could be\n  taken straight from a compiler, be resolved using [source-map-resolve] or\n  created using [source-map-dummy].\n- `sourcesRelativeTo`: A path that `file.map.sources` are relative to. Defaults\n  to `.`.\n\n`options`:\n\n- `delimiter`: A string to insert between each file.\n- `process(node, file, index)`: A function to call on each file in `files`.\n  `node` is a [`SourceNode`]. You could use this to wrap JavaScript files in\n  IIFEs, for example.\n- `mapPath`: The path to where you intend to write the source map of the\n  produced concatenated file. Defaults to `.`.\n\nThe files in `files` will be concatenated into a [`SourceNode`] which is\nreturned. You may then modify this source node if you wish (`node.add(...)` for\nexample). When you’re done, call `node.toStringWithSourceMap()`, which returns\nan object with a `code` property containing the concatenated code, and a `map`\nproperty containing the source map.\n\n[source-map-resolve]: https://github.com/lydell/source-map-resolve\n[source-map-dummy]: https://github.com/lydell/source-map-dummy\n[`SourceNode`]: https://github.com/mozilla/source-map#sourcenode\n[`SourceMapGenerator`]: https://github.com/mozilla/source-map#sourcemapgenerator\n\n\nLicense\n=======\n\n[The X11 (“MIT”) License](LICENSE).\n",
  "readmeFilename": "readme.md",
  "_id": "source-map-concat@1.0.1",
  "dist": {
    "shasum": "03be7c8f70aba0e084ec94a720a929e52e90c3b8"
  },
  "_from": "source-map-concat@^1.0.0",
  "_resolved": "https://registry.npmjs.org/source-map-concat/-/source-map-concat-1.0.1.tgz"
}
