source-map-to-comment

3.0.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i source-map-to-comment

    Weekly Downloads

    552

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.87 kB

    Total Files

    4

    Last publish

    Collaborators

    • sindresorhus