3.0.0 • Published 3 years ago

source-map-to-comment v3.0.0

Weekly downloads
3,675
License
MIT
Repository
github
Last release
3 years ago

source-map-to-comment

Convert a Source Map object to a comment

Install

$ npm install source-map-to-comment

Usage

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... */'