@cjser/source-map-to-comment
v3.0.0-cjser.2
Published
Convert a Source Map object to a comment
Maintainers
Readme
source-map-to-comment
Convert a Source Map object to a comment
Install
$ npm install source-map-to-commentUsage
import sourceMapToComment from 'source-map-to-comment';
const sourceMap = getSourceMapObjectFromSomething();
sourceMapToComment(sourceMap);
//=> '//# sourceMappingURL=data:application/json;base64,eyJ2Z...'
sourceMapToComment(JSON.stringify(sourceMap));
//=> '//# sourceMappingURL=data:application/json;base64,eyJ2Z...'
sourceMapToComment(sourceMap, {type: 'css'});
//=> '/*# sourceMappingURL=data:application/json;base64,eyJ2Z... */'cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/source-map-to-comment
