-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
43 lines (43 loc) · 4.75 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
"name": "convert-source-map",
"version": "0.3.5",
"description": "Converts a source-map from/to different formats and allows adding/changing properties.",
"main": "index.js",
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/thlorenz/convert-source-map.git"
},
"homepage": "https://github.com/thlorenz/convert-source-map",
"dependencies": {},
"devDependencies": {
"inline-source-map": "~0.3.0",
"tap": "~0.4.3"
},
"keywords": [
"convert",
"sourcemap",
"source",
"map",
"browser",
"debug"
],
"author": {
"name": "Thorsten Lorenz",
"email": "thlorenz@gmx.de",
"url": "http://thlorenz.com"
},
"license": "MIT",
"engine": {
"node": ">=0.6"
},
"readme": "# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map)\n\n[![NPM](https://nodei.co/npm/convert-source-map.png?downloads=true&stars=true)](https://nodei.co/npm/convert-source-map/)\n\nConverts a source-map from/to different formats and allows adding/changing properties.\n\n```js\nvar convert = require('convert-source-map');\n\nvar json = convert\n .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')\n .toJSON();\n\nvar modified = convert\n .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')\n .setProperty('sources', [ 'CONSOLE.LOG(\"HI\");' ])\n .toJSON();\n\nconsole.log(json);\nconsole.log(modified);\n```\n\n```json\n{\"version\":3,\"file\":\"foo.js\",\"sources\":[\"console.log(\\\"hi\\\");\"],\"names\":[],\"mappings\":\"AAAA\",\"sourceRoot\":\"/\"}\n{\"version\":3,\"file\":\"foo.js\",\"sources\":[\"CONSOLE.LOG(\\\"HI\\\");\"],\"names\":[],\"mappings\":\"AAAA\",\"sourceRoot\":\"/\"}\n```\n\n## API\n\n### fromObject(obj)\n\nReturns source map converter from given object.\n\n### fromJSON(json)\n\nReturns source map converter from given json string.\n\n### fromBase64(base64)\n\nReturns source map converter from given base64 encoded json string.\n\n### fromComment(comment)\n\nReturns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`.\n\n### fromMapFileComment(comment, mapFileDir)\n\nReturns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`.\n\n`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the\ngenerated file, i.e. the one containing the source map.\n\n### fromSource(source)\n\nFinds last sourcemap comment in file and returns source map converter or returns null if no source map comment was\nfound.\n\n### fromMapFileSource(source, mapFileDir)\n\nFinds last sourcemap comment in file and returns source map converter or returns null if no source map comment was\nfound.\n\nThe sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see\nfromMapFileComment.\n\n### toObject()\n\nReturns a copy of the underlying source map.\n\n### toJSON([space])\n\nConverts source map to json string. If `space` is given (optional), this will be passed to\n[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the\nJSON string is generated.\n\n### toBase64()\n\nConverts source map to base64 encoded json string.\n\n### toComment()\n\nConverts source map to base64 encoded json string prefixed with `//# sourceMappingURL=...`.\n\n### addProperty(key, value)\n\nAdds given property to the source map. Throws an error if property already exists.\n\n### setProperty(key, value)\n\nSets given property to the source map. If property doesn't exist it is added, otherwise its value is updated.\n\n### getProperty(key)\n\nGets given property of the source map.\n\n### removeComments(src)\n\nReturns `src` with all source map comments removed\n\n### removeMapFileComments(src)\n\nReturns `src` with all source map comments pointing to map files removed.\n\n### commentRegex\n\nReturns the regex used to find source map comments.\n\n### mapFileCommentRegex\n\nReturns the regex used to find source map comments pointing to map files.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/thlorenz/convert-source-map/issues"
},
"_id": "convert-source-map@0.3.5",
"_from": "convert-source-map@~0.3.0"
}