{"name":"vinyl-sourcemap","version":"0.3.0","description":"Add sourcemaps to vinyl files, extracted from gulp-sourcemaps by Florian Reiterer (https://github.com/floridoo/gulp-sourcemaps)","main":"index.js","scripts":{"test":"mocha --async-only"},"keywords":["vinyl","sourcemap","gulp"],"author":{"name":"Robin Venneman"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/gulpjs/vinyl-sourcemap.git"},"devDependencies":{"eslint":"^1.7.3","eslint-config-gulp":"^2.0.0","expect":"^1.20.2","mocha":"^3.2.0","vinyl-fs":"^2.4.3"},"dependencies":{"acorn":"^4.0.3","async":"^2.1.4","convert-source-map":"1.3.0","css":"^2.2.1","detect-newline":"^2.1.0","graceful-fs":"^4.1.6","object.defaults":"^1.0.0","source-map":"^0.5.6","strip-bom":"^2.0.0","through2":"^2.0.1","vinyl":"^1.2.0"},"gitHead":"4f9eb00f04024cb834b879d29618aa00b7cf7bcb","bugs":{"url":"https://github.com/gulpjs/vinyl-sourcemap/issues"},"homepage":"https://github.com/gulpjs/vinyl-sourcemap#readme","_id":"vinyl-sourcemap@0.3.0","_shasum":"99d54fbadf26fee99fbe79437f81f1462e511e0c","_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":"99d54fbadf26fee99fbe79437f81f1462e511e0c","tarball":"http://registry-npm.ywwl.com/vinyl-sourcemap/download/vinyl-sourcemap-0.3.0.tgz","integrity":"sha512-knNzxUnN0fDKOmiNpcI7OD2bx0GeDhs8OG4m5fw6MHWfECPs9WEx1/oE0vY8yWQQKEeqrRudVRBUttMpzeWhaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLcPjweKSb1EzDgvvbxCCyaDZHeirFC/Pbk0fCfSu6xAIhAK012um00bWOaalqhII1zPXg0WA0R+FlZZ313k5zegeZ"}],"size":9343,"noattachment":false,"key":"/vinyl-sourcemap/-/vinyl-sourcemap-0.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/vinyl-sourcemap-0.3.0.tgz_1490312935591_0.18210251280106604"},"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":1490312937696,"_cnpm_publish_time":1490312937696,"dist-tags":{"latest":"2.0.0"}}