JSPM

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

Package Exports

  • enb-source-map/lib/error-builder
  • enb-source-map/lib/file
  • enb-source-map/lib/source-locator
  • enb-source-map/lib/utils

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (enb-source-map) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

enb-source-map

NPM version Build Status Dependency Status

Помошник для работы с картами кода.

Пример

var fs = require('fs'),
    File = require('enb-source-map/lib/file'),
    file = new File('output.js', { sourceMap: { from: 'bundle.js', prev: { /*
    source map object */ } });

file
    .write('line')
    .writeLine('-1')
    .writeFileContent('input-1.js', fs.readFileSync('input-1.js', 'utf-8'))
    .writeFileFragment('input-2.js', fs.readFileSync('input-2.js', 'utf-8').split('\n').pop(), 1, 0)
    .writeLine('line 2');

file.getContent();
// line-1
// input-1-contents
// input-2-fragment
// line 2
file.getSourceMap();
// {
//   version: 3,
//   sources: [ 'input-1.js', 'input-2.js' ],
//   names: [],
//   mappings: ';AAAA;ACAA',
//   file: 'output.js'
// }