Skip to documentation

reference

Migration — @stackline/convert-source-map

Project migration notes for @stackline/convert-source-map 1.0.4. Review behavior, requirements and limitations.

Versioned project notes for @stackline/convert-source-map 1.0.4. Original attribution is retained in the linked repository.

Migration

Direct package name

npm install @stackline/convert-source-map
const convert = require('@stackline/convert-source-map');

Drop-in dependency replacement

Keep existing source imports by installing an npm alias:

npm install convert-source-map@npm:@stackline/convert-source-map

Existing code stays unchanged:

const convert = require('convert-source-map');

The equivalent manifest entry is:

{
  "dependencies": {
    "convert-source-map": "npm:@stackline/convert-source-map@^1.0.0"
  }
}

Commit the regenerated lockfile and run the consuming project's complete test suite. Consumers on Node.js below 12 must upgrade Node before migrating.

External map readers

The package preserves the version 2 callback signature:

const converter = convert.fromMapFileComment(comment, filename => {
  return fs.readFileSync(filename, 'utf8');
});

Do not pass a directory string. Validate or constrain filename in the callback when comments come from untrusted content.

Package reference