npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

source-map-to-comment

3.0.0

@sindresorhus

npmHomeRepoSnykSocket
Downloads:1812
$ npm install source-map-to-comment
DailyWeeklyMonthlyYearly

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