JSPM

source-map-to-comment

3.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1135
  • Score
    100M100P100Q110652F
  • License MIT

Convert a Source Map object to a comment

Package Exports

  • source-map-to-comment

Readme

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