mirror of
https://github.com/denoland/deno.git
synced 2024-12-02 17:01:14 -05:00
1 line
5.2 KiB
JSON
1 line
5.2 KiB
JSON
{"name":"sourcemap-codec","description":"Encode/decode sourcemap mappings","dist-tags":{"latest":"1.4.8"},"versions":{"1.4.8":{"name":"sourcemap-codec","version":"1.4.8","description":"Encode/decode sourcemap mappings","main":"dist/sourcemap-codec.umd.js","module":"dist/sourcemap-codec.es.js","types":"dist/types/sourcemap-codec.d.ts","scripts":{"test":"mocha","build":"rm -rf dist && rollup -c && tsc","pretest":"npm run build","prepublish":"npm test","lint":"eslint src","pretest-coverage":"npm run build","test-coverage":"rm -rf coverage/* && istanbul cover --report json node_modules/.bin/_mocha -- -u exports -R spec test/test.js","posttest-coverage":"remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped.json -b dist && remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped.lcov -t lcovonly -b dist && remap-istanbul -i coverage/coverage-final.json -o coverage/coverage-remapped -t html -b dist","ci":"npm run test-coverage && codecov < coverage/coverage-remapped.lcov"},"repository":{"type":"git","url":"git+https://github.com/Rich-Harris/sourcemap-codec.git"},"author":{"name":"Rich Harris"},"license":"MIT","bugs":{"url":"https://github.com/Rich-Harris/sourcemap-codec/issues"},"dependencies":{},"devDependencies":{"codecov.io":"^0.1.6","console-group":"^0.3.3","eslint":"^6.0.1","eslint-plugin-import":"^2.18.0","istanbul":"^0.4.5","mocha":"^6.1.4","remap-istanbul":"^0.13.0","rollup":"^1.16.4","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-typescript":"^1.0.1","typescript":"^3.5.2"},"gitHead":"b549c1ee22f79bdf777d7bfe6471fe4293cd6391","_id":"sourcemap-codec@1.4.8","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==","shasum":"ea804bd94857402e6992d05a38ef1ae35a9ab4c4","tarball":"http://localhost:4260/sourcemap-codec/sourcemap-codec-1.4.8.tgz","fileCount":9,"unpackedSize":31802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeILE7CRA9TVsSAnZWagAAO5IP/ir1Y0zaBX8RUmDU3tmc\nyBctHIgYMg5sg3Le9OtPgvpgYvKvAaKzQ8KfR0iEBWz+8AvJyPDRHpvRUk3r\nYufljidkG5mu4C6Hvv1nJDu76TspGkq34x7K0kZxf/iamsY1lKA2qu6h9bnw\n0JoQDvT0m4iXh0dOfrdJGMqcWlH6nkqOuZ4QJkaile3j04H2eGet2f4VyqV5\nJbp400SBW62ZUMe4t6z0CzdJ3K+rMMji2rayQEmUXIpSrizs0u6ct+CeFlc5\njbw7f4VdowOcguHuYG1uxbaNOeyGz6J70Cq8BsIrAVIx92T+RFiNsenr1NU9\nicQ/C9DpM83rpHaWw2zdjoqVrjBbrLEcriS/kdvr4fweIfmoCKGcwZYPV7J/\nexuaWHI9dbcyOXh8ty4NL0ZU9djXplnT6PJzKS7gO00rk66MJ+rhMFNS+01k\nv0K5IRrEhePqJjde/2veWoDkIS4U9gYavgjiTbX3W9ZGkrajrUSijGpg09RR\ne/Ol3lvurNRAF+J79ZtPXZ4iXp87JBvnGRTICfXZH8Np7vBh2DzBlnoq3e74\nzKyc7kpVY7V52RfyYrKK1oT52UMHjp6ojbKOTxAmDaES4gw3Md6Y4pjud8Hj\ntPYqTZIz31NnMruItfc1K6VHZaP8vhZeZ7QGQJTuYUMw7Y6FQXazQy84yhUE\n87zp\r\n=HgDw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsOkd0bndP6/9iZ5q+pwDgckx3BKgb3p+0fgjFiO2JrgIgeYv1UAPWqIC5ZynHugZffLb/i3gM35qaFRiw6RpSjnE="}]},"directories":{},"_hasShrinkwrap":false}},"readme":"# sourcemap-codec\n\nEncode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit).\n\n\n## Why?\n\nSourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap.\n\nThis package makes the process slightly easier.\n\n\n## Installation\n\n```bash\nnpm install sourcemap-codec\n```\n\n\n## Usage\n\n```js\nimport { encode, decode } from 'sourcemap-codec';\n\nvar decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );\n\nassert.deepEqual( decoded, [\n\t// the first line (of the generated code) has no mappings,\n\t// as shown by the starting semi-colon (which separates lines)\n\t[],\n\n\t// the second line contains four (comma-separated) segments\n\t[\n\t\t// segments are encoded as you'd expect:\n\t\t// [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ]\n\n\t\t// i.e. the first segment begins at column 2, and maps back to the second column\n\t\t// of the second line (both zero-based) of the 0th source, and uses the 0th\n\t\t// name in the `map.names` array\n\t\t[ 2, 0, 2, 2, 0 ],\n\n\t\t// the remaining segments are 4-length rather than 5-length,\n\t\t// because they don't map a name\n\t\t[ 4, 0, 2, 4 ],\n\t\t[ 6, 0, 2, 5 ],\n\t\t[ 7, 0, 2, 7 ]\n\t],\n\n\t// the final line contains two segments\n\t[\n\t\t[ 2, 1, 10, 19 ],\n\t\t[ 12, 1, 11, 20 ]\n\t]\n]);\n\nvar encoded = encode( decoded );\nassert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );\n```\n\n\n# License\n\nMIT\n","homepage":"https://github.com/Rich-Harris/sourcemap-codec","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/sourcemap-codec.git"},"author":{"name":"Rich Harris"},"bugs":{"url":"https://github.com/Rich-Harris/sourcemap-codec/issues"},"license":"MIT","readmeFilename":"README.md"}
|