{ "name": "inline-source-map", "version": "0.2.3", "description": "Adds source mappings and base64 encodes them, so they can be inlined in your generated file.", "main": "inline-source-map.js", "scripts": { "test": "node-trap ./test/*.js && node-trap test/source-content.js" }, "repository": { "type": "git", "url": "git://github.com/thlorenz/inline-source-map.git" }, "homepage": "https://github.com/thlorenz/inline-source-map", "dependencies": { "source-map": "~0.1.9" }, "devDependencies": { "trap": "~0.4.2" }, "keywords": [ "source", "map", "inline", "base64", "bundle", "generate", "transpile" ], "author": { "name": "Thorsten Lorenz", "email": "thlorenz@gmx.de", "url": "http://thlorenz.com" }, "license": "MIT", "engine": { "node": ">=0.6" }, "readme": "# inline-source-map [![build status](https://secure.travis-ci.org/thlorenz/inline-source-map.png)](http://travis-ci.org/thlorenz/inline-source-map)\n\nAdds source mappings and base64 encodes them, so they can be inlined in your generated file.\n\n```js\nvar generator = require('inline-source-map');\n\nvar gen = generator()\n .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 })\n .addGeneratedMappings('bar.js', 'var a = 2;\\nconsole.log(a)', { line: 23, column: 22 });\n\nconsole.log('base64 mapping:', gen.base64Encode());\nconsole.log('inline mapping url:', gen.inlineMappingUrl());\n```\n\n```\nbase64 mapping: eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0=\ninline mapping url: //@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0=\n```\n\n## API\n\n### addMappings(sourceFile, mappings, offset)\n\n```\n/**\n * Adds the given mappings to the generator and offsets them if offset is given \n *\n * @name addMappings\n * @function\n * @param sourceFile {String} name of the source file\n * @param mappings {Array{{Object}} each object has the form { original: { line: _, column: _ }, generated: { line: _, column: _ } }\n * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ }\n * @return {Object} the generator to allow chaining\n */\n```\n\n### addGeneratedMappings(sourceFile, source, offset)\n\n```\n/**\n * Generates mappings for the given source and adds them, assuming that no translation from original to generated is necessary.\n *\n * @name addGeneratedMappings\n * @function\n * @param sourceFile {String} name of the source file\n * @param source {String} source of the file\n * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ }\n * @return {Object} the generator to allow chaining\n */\n```\n\n### addSourceContent(sourceFile, sourceContent)\n\n```\n/**\n * Adds source content for the given source file.\n * \n * @name addSourceContent\n * @function\n * @param sourceFile {String} The source file for which a mapping is included\n * @param sourceContent {String} The content of the source file\n * @return {Object} The generator to allow chaining\n */\n```\n\n\n### base64Encode()\n\n```\n/**\n * @name base64Encode\n * @function\n * @return {String} bas64 encoded representation of the added mappings\n */\n```\n\nIf source contents were added, this will be included in the encoded mappings.\n\n### inlineMappingUrl()\n\n```\n/**\n * @name inlineMappingUrl\n * @function\n * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. \n */\n```\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/thlorenz/inline-source-map/issues" }, "_id": "inline-source-map@0.2.3", "dist": { "shasum": "ba0c9189acc81a6233baacd50a637ff7e37b9aea" }, "_from": "inline-source-map@~0.2.1", "_resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.2.3.tgz" }