--- /dev/null
+{
+ "name": "source-map-support",
+ "description": "Fixes stack traces for files with source maps",
+ "version": "0.2.10",
+ "main": "./source-map-support.js",
+ "scripts": {
+ "test": "node_modules/mocha/bin/mocha"
+ },
+ "dependencies": {
+ "source-map": "0.1.32"
+ },
+ "devDependencies": {
+ "coffee-script": "1.7.1",
+ "browserify": "3.44.2",
+ "mocha": "1.18.2"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/evanw/node-source-map-support"
+ },
+ "bugs": {
+ "url": "https://github.com/evanw/node-source-map-support/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT"
+ }
+ ],
+ "readme": "# Source Map Support\n\nThis module provides source map support for stack traces in node via the [V8 stack trace API](http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi). It uses the [source-map](https://github.com/mozilla/source-map) module to replace the paths and line numbers of source-mapped files with their original paths and line numbers. The output mimics node's stack trace format with the goal of making every compile-to-JS language more of a first-class citizen. Source maps are completely general (not specific to any one language) so you can use source maps with multiple compile-to-JS languages in the same node process.\n\n## Installation and Usage\n\n#### Node support\n\n npm install source-map-support\n\nSource maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, insert the following two lines at the top of your compiled code:\n\n //# sourceMappingURL=path/to/source.map\n require('source-map-support').install();\n\nThe path should either be absolute or relative to the compiled file.\n\n#### Browser support\n\nThis library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code.\n\nThis library also works if you use another build process or just include the source files directly. In this case, include the file `browser-source-map-support.js` in your page and call `sourceMapSupport.install()`. It contains the whole library already bundled for the browser using browserify.\n\n <script src=\"browser-source-map-support.js\"></script>\n <script>sourceMapSupport.install();</script>\n\nThis library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency:\n\n <script>\n define(['browser-source-map-support'], function(sourceMapSupport) {\n sourceMapSupport.install();\n });\n </script>\n\n## Options\n\nThis module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer:\n\n require('source-map-support').install({\n handleUncaughtExceptions: false\n });\n\nThis module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access.\n\n require('source-map-support').install({\n retrieveSourceMap: function(source) {\n if (source === 'compiled.js') {\n return {\n url: 'original.js',\n map: fs.readFileSync('compiled.js.map', 'utf8')\n };\n }\n return null;\n }\n });\n\n## Demos\n\n#### Basic Demo\n\noriginal.js:\n\n throw new Error('test'); // This is the original code\n\ncompiled.js:\n\n //# sourceMappingURL=compiled.js.map\n require('source-map-support').install();\n\n throw new Error('test'); // This is the compiled code\n\ncompiled.js.map:\n\n {\n \"version\": 3,\n \"file\": \"compiled.js\",\n \"sources\": [\"original.js\"],\n \"names\": [],\n \"mappings\": \";;;AAAA,MAAM,IAAI\"\n }\n\nRun compiled.js using node (notice how the stack trace uses original.js instead of compiled.js):\n\n $ node compiled.js\n\n original.js:1\n throw new Error('test'); // This is the original code\n ^\n Error: test\n at Object.<anonymous> (original.js:1:7)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Function.Module.runMain (module.js:497:10)\n at startup (node.js:119:16)\n at node.js:901:3\n\n#### TypeScript Demo\n\ndemo.ts:\n\n declare function require(name: string);\n require('source-map-support').install();\n class Foo {\n constructor() { this.bar(); }\n bar() { throw new Error('this is a demo'); }\n }\n new Foo();\n\nCompile and run the file using the TypeScript compiler from the terminal:\n\n $ npm install source-map-support typescript\n $ node_modules/typescript/bin/tsc -sourcemap demo.ts\n $ node demo.js\n\n demo.ts:5\n bar() { throw new Error('this is a demo'); }\n ^\n Error: this is a demo\n at Foo.bar (demo.ts:5:17)\n at new Foo (demo.ts:4:24)\n at Object.<anonymous> (demo.ts:7:1)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Function.Module.runMain (module.js:497:10)\n at startup (node.js:119:16)\n at node.js:901:3\n\n#### CoffeeScript Demo\n\ndemo.coffee:\n\n require('source-map-support').install()\n foo = ->\n bar = -> throw new Error 'this is a demo'\n bar()\n foo()\n\nCompile and run the file using the CoffeeScript compiler from the terminal:\n\n $ npm install source-map-support coffee-script\n $ node_modules/coffee-script/bin/coffee --map --compile demo.coffee\n $ node demo.js\n\n demo.coffee:3\n bar = -> throw new Error 'this is a demo'\n ^\n Error: this is a demo\n at bar (demo.coffee:3:22)\n at foo (demo.coffee:4:3)\n at Object.<anonymous> (demo.coffee:5:1)\n at Object.<anonymous> (demo.coffee:1:1)\n at Module._compile (module.js:456:26)\n at Object.Module._extensions..js (module.js:474:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n at Function.Module.runMain (module.js:497:10)\n at startup (node.js:119:16)\n\n## License\n\nThis code is available under the [MIT license](http://opensource.org/licenses/MIT).\n",
+ "readmeFilename": "README.md",
+ "_id": "source-map-support@0.2.10",
+ "_from": "source-map-support@~0.2.6"
+}