{"name":"vinyl-sourcemap","version":"1.0.0","description":"Add/write sourcemaps to/from Vinyl files.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Robin Venneman"},{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/vinyl-sourcemap.git"},"license":"MIT","engines":{"node":">= 0.10"},"main":"index.js","files":["LICENSE","index.js","lib/"],"scripts":{"lint":"eslint index.js lib/ test/add.js test/write.js && jscs index.js lib/ test/add.js test/write.js","pretest":"npm run lint","test":"mocha --async-only","cover":"istanbul cover _mocha --report lcovonly","coveralls":"npm run cover && istanbul-coveralls"},"dependencies":{"convert-source-map":"^1.5.0","file-normalize":"^1.1.0","graceful-fs":"^4.1.6","now-and-later":"^2.0.0","vinyl":"^2.0.0"},"devDependencies":{"eslint":"^1.10.3","eslint-config-gulp":"^2.0.0","expect":"^1.20.2","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","jscs":"^2.4.0","jscs-preset-gulp":"^1.0.0","mississippi":"^1.3.0","mocha":"^3.2.0"},"keywords":["vinyl","sourcemap","gulp"],"gitHead":"14ddac31b66d2cbd0c4e9b181ad1490fad56611b","bugs":{"url":"https://github.com/gulpjs/vinyl-sourcemap/issues"},"homepage":"https://github.com/gulpjs/vinyl-sourcemap#readme","_id":"vinyl-sourcemap@1.0.0","_shasum":"1dadb75097dc922c4a4aab92bbaa93c8d9c076bc","_from":".","_npmVersion":"2.15.2","_nodeVersion":"0.10.41","_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"}],"dist":{"shasum":"1dadb75097dc922c4a4aab92bbaa93c8d9c076bc","tarball":"http://registry-npm.ywwl.com/vinyl-sourcemap/download/vinyl-sourcemap-1.0.0.tgz","integrity":"sha512-u/hXmopZTJxJALMj4SwKd+haDm9XBpiwYjeBtCcS231D1ddfh8KhXV6APX7efVRmpnNXuoihIYItCsfMMVqNUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkqUKoGFSwGpXcYl8Qqq4vXuXg3Ny8vz843s22uwY2dQIhALSiZFRAf0U0zDwmqMHtJdQJ+xj5a3z2Mhv5BqoAYuaM"}],"size":4899,"noattachment":false,"key":"/vinyl-sourcemap/-/vinyl-sourcemap-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vinyl-sourcemap-1.0.0.tgz_1497817206550_0.9947819525841624"},"directories":{},"readme":"<p align=\"center\">\n  <a href=\"https://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# vinyl-sourcemap\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nAdd/write sourcemaps to/from Vinyl files.\n\n## Usage\n\n```js\nsourcemap.add(file, function (err, updatedFile) {\n  // updatedFile will have a .sourceMap property\n});\n\n// The 2nd argument can be given as a path string\nsourcemap.write(file, './maps', function (err, updatedFile, sourcemapFile) {\n  // sourcemapFile will be a Vinyl file to be written to some location\n  // updatedFile will have the .contents property updated with a sourceMappingURL that resolves to sourcemapFile\n});\n\n// If not defined, the sourcemap is inlined\nsourcemap.write(file, function (err, updatedFile, sourcemapFile) {\n  // sourcemapFile is undefined\n  // updatedFile will have the .contents property updated with a sourceMappingURL that is an inlined sourcemap\n});\n```\n\n## API\n\n### `sourcemap.add(file, callback)`\n\nTakes a [Vinyl][vinyl] `file` object and a `callback` function. It attempts to parse an inline sourcemap or load an external sourcemap for the file. If a valid sourcemap is found, the `sources` & `sourcesContent` properties are resolved to actual files (if possible) and a fully resolved sourcemap is attached as `file.sourceMap`. If a sourcemap is not found, a stub sourcemap is generated for the file and attached as `file.sourceMap`.\n\nOnce all resolution is complete, the `callback(err, updatedFile)` is called with the `updatedFile`. If an error occurs, it will be passed as `err` and `updatedFile` will be undefined. **Note:** The original file is mutated but `updatedFile` is passed to the callback as a convenience.\n\nIf the `file` is not a Vinyl object or the contents are streaming, an Error will be passed to the `callback`.\n\nIf the `file` has a `.sourceMap` property or the contents are null, the `callback` will be called immediately without mutation to the file.\n\nAll filesystem operations are optional & non-fatal so any errors will not be bubbled to the `callback`.\n\n### `sourcemap.write(file, [outputPath,] callback)`\n\nTakes a [Vinyl][vinyl] `file` object, (optionally) an `outputPath` string and a `callback` function.\n\nIf `outputPath` is not passed, an inline sourcemap will be generated from the `file.sourceMap` property and appended to the `file.contents`. Once the inline sourcemap is appended, the `callback(err, updatedFile)` is called with the `updatedFile`. If an error occurs, it will be passed as `err` and `updatedFile` will be undefined. **Note:** The original file is mutated but `updatedFile` is passed to the callback as a convenience.\n\nIf `outputPath` is passed, a new Vinyl file will be generated using `file.cwd` and `file.base` from the original file, the path to the external sourcemap, and the `file.sourceMap` (as contents). The external location will be appended to the `file.contents` of the original file. Once the new file is created and location appended, the `callback(err, updatedFile, sourcemapFile)` is called with the `updatedFile` and the `sourcemapFile`. If an error occurs, it will be passed as `err` and `updatedFile`/`sourcemapFile` will be undefined. **Note:** The original file is mutated but `updatedFile` is passed to the callback as a convenience.\n\nIf the `file` is not a Vinyl object or the contents are streaming, an Error will be passed to the `callback`.\n\nIf the `file` doesn't have a `.sourceMap` property or the contents are null, the `callback` will be called immediately without mutation to the file.\n\n## License\n\nMIT\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/vinyl-sourcemap.svg?style=flat-square\n[npm-url]: https://npmjs.com/package/vinyl-sourcemap\n[npm-image]: https://img.shields.io/npm/v/vinyl-sourcemap.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/vinyl-sourcemap/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/vinyl-sourcemap/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl-sourcemap\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl-sourcemap/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n\n<!-- prettier-ignore-start -->\n[vinyl]: https://github.com/gulpjs/vinyl\n<!-- prettier-ignore-end -->\n","publish_time":1497817206680,"_cnpm_publish_time":1497817206680,"dist-tags":{"latest":"2.0.0"}}