{"name":"combine-source-map","version":"0.8.0","description":"Add source maps of multiple files, offset them and then combine them into one source map","main":"index.js","scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/combine-source-map.git"},"homepage":"https://github.com/thlorenz/combine-source-map","dependencies":{"convert-source-map":"~1.1.0","inline-source-map":"~0.6.0","lodash.memoize":"~3.0.3","source-map":"~0.5.3"},"devDependencies":{"tap":"~0.4.3"},"keywords":["source","map","sourcemap","bundle","combine","cat","sourceMappingUrl","browserify"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":"MIT","engine":{"node":">=0.6"},"gitHead":"a75f6c2461943239a9d32a4413f226667bc82fd0","bugs":{"url":"https://github.com/thlorenz/combine-source-map/issues"},"_id":"combine-source-map@0.8.0","_shasum":"a58d0df042c186fcf822a8e8015f5450d2d79a8b","_from":".","_npmVersion":"2.15.11","_nodeVersion":"6.7.0","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"dist":{"shasum":"a58d0df042c186fcf822a8e8015f5450d2d79a8b","tarball":"http://registry-npm.ywwl.com/combine-source-map/download/combine-source-map-0.8.0.tgz","integrity":"sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIArWL0ELFhfql8ILffV2UznMlUStjvxqB0m8MUyzyTFfAiEAwFe7kMzeupx14YJs91ahysNgLdn3nh/3GTm91q+qPkM="}],"size":6818,"noattachment":false,"key":"/combine-source-map/-/combine-source-map-0.8.0.tgz"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"},{"name":"zertosh","email":"zertosh@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/combine-source-map-0.8.0.tgz_1490008573978_0.022306202445179224"},"directories":{},"readme":"# combine-source-map [![build status](https://secure.travis-ci.org/thlorenz/combine-source-map.png)](http://travis-ci.org/thlorenz/combine-source-map)\n\nAdd source maps of multiple files, offset them and then combine them into one source map.\n\n```js\nvar convert = require('convert-source-map');\nvar combine = require('combine-source-map');\n\nvar fooComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] pzJylcbiJdfQ==';\nvar barComment = '//# sourceMappingURL=data:application/json;base64,eyJ2Z [..] VjaycpXG4iXX0=';\n\nvar fooFile = {\n    source: '(function() {\\n\\n  console.log(require(\\'./bar.js\\'));\\n\\n}).call(this);\\n' + '\\n' + fooComment\n  , sourceFile: 'foo.js'\n};\nvar barFile = {\n    source: '(function() {\\n\\n  console.log(alert(\\'alerts suck\\'));\\n\\n}).call(this);\\n' + '\\n' + barComment\n  , sourceFile: 'bar.js'\n};\n\nvar offset = { line: 2 };\nvar base64 = combine\n  .create('bundle.js')\n  .addFile(fooFile, offset)\n  .addFile(barFile, { line: offset.line + 8 })\n  .base64();\n\nvar sm = convert.fromBase64(base64).toObject();\nconsole.log(sm);\n```\n\n```\n{ version: 3,\n  file: 'bundle.js',\n  sources: [ 'foo.coffee', 'bar.coffee' ],\n  names: [],\n  mappings: ';;;AAAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ;;;;;ACAA;CAAA;CAAA,CAAA,CAAA,IAAO,GAAK;CAAZ',\n  sourcesContent:\n   [ 'console.log(require \\'./bar.js\\')\\n',\n     'console.log(alert \\'alerts suck\\')\\n' ] }\n```\n\n## Installation\n\n    npm install combine-source-map\n\n## API\n\n### create()\n\n```\n/**\n * @name create\n * @function\n * @param file {String} optional name of the generated file\n * @param sourceRoot { String} optional sourceRoot of the map to be generated\n * @return {Object} Combiner instance to which source maps can be added and later combined\n */\n```\n\n### Combiner.prototype.addFile(opts, offset)\n\n```\n/**\n * Adds map to underlying source map.\n * If source contains a source map comment that has the source of the original file inlined it will offset these\n * mappings and include them.\n * If no source map comment is found or it has no source inlined, mappings for the file will be generated and included\n * \n * @name addMap\n * @function\n * @param opts {Object} { sourceFile: {String}, source: {String} }\n * @param offset {Object} { line: {Number}, column: {Number} }\n */\n```\n\n### Combiner.prototype.base64()\n\n```\n/**\n* @name base64\n* @function\n* @return {String} base64 encoded combined source map\n*/\n```\n\n### Combiner.prototype.comment()\n\n```\n/**\n * @name comment\n * @function\n * @return {String} base64 encoded sourceMappingUrl comment of the combined source map\n */\n```\n\n### removeComments(src)\n\n```\n/**\n * @name removeComments\n * @function\n * @param src \n * @return {String} src with all sourceMappingUrl comments removed\n */\n```\n\n## Example \n\nRead and run the [more elaborate example](https://github.com/thlorenz/combine-source-map/blob/master/example/two-files.js) \nin order to get a better idea how things work.\n","publish_time":1490008575889,"_cnpm_publish_time":1490008575889,"dist-tags":{"latest":"0.8.0"}}