npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stackline/inline-source-map

v1.0.1

Published

Maintained inline-source-map-compatible generator for Node.js, TypeScript, CommonJS, ESM, and browser bundles

Readme

@stackline/inline-source-map

A maintained, typed, inline-source-map-compatible generator for modern Node.js and browser build pipelines.

npm version npm downloads CI license

Docs and playground | npm | GitHub | Migration | Security | Changelog

Current package version: 1.0.1

Why this package?

inline-source-map remains embedded in build tools and transpilers, but its published package still targets an old source-map generator and its upstream test workflow does not exercise modern Node.js releases.

This fork preserves the compact CommonJS API while adding:

  • current source-map generation through [email protected];
  • CommonJS, Node ESM, TypeScript, and browser-bundle verification;
  • TypeScript declarations without changing the JavaScript call shape;
  • null-prototype storage for source file names such as __proto__;
  • UTF-8 base64 encoding in browsers with no global Buffer;
  • reproducible package, compatibility, coverage, and install tests;
  • preserved MIT attribution to the original project.

No runtime security advisory is claimed for the upstream package. This fork is about maintained compatibility, modern verification, and defensive defaults.

Compatibility at a glance

| Item | Value | | :--- | :--- | | Package | @stackline/[email protected] | | API baseline | [email protected] | | Runtime | Node.js 12+, browser bundles | | Modules | Callable CommonJS with Node ESM default import | | Types | First-party TypeScript declarations | | Runtime dependencies | One maintained source-map generator |

Installation

Install under the public Stackline name:

npm install @stackline/inline-source-map

Or replace the original package without changing imports:

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

Existing CommonJS remains unchanged:

const inlineSourceMap = require('inline-source-map');

Quick start

const inlineSourceMap = require('@stackline/inline-source-map');

const source = [
  'const answer = 42;',
  'console.log(answer);'
].join('\n');

const map = inlineSourceMap({ file: 'bundle.js' })
  .addGeneratedMappings('answer.js', source)
  .addSourceContent('answer.js', source);

const output = source + '\n' + map.inlineMappingUrl();

ESM

Node.js exposes the callable CommonJS export as the default import:

import inlineSourceMap from '@stackline/inline-source-map';

const map = inlineSourceMap().addGeneratedMappings('input.js', 'let x = 1;');

The package intentionally retains one CommonJS implementation instead of shipping divergent ESM and CommonJS code paths.

API

inlineSourceMap(options?)

Creates a Generator. Supported options are file, sourceRoot, and charset. The default charset label is utf-8.

generator.addGeneratedMappings(sourceFile, source, offset?)

Adds an identity mapping for every source line. As in the original package, line and column offsets are applied to every generated mapping.

generator.addMappings(sourceFile, mappings, offset?)

Adds supplied generated/original positions. A mapping without original produces a generated-only source-map segment.

generator.addSourceContent(sourceFile, sourceContent)

Embeds source text. File names are stored in a null-prototype dictionary, so special JavaScript object names are handled as ordinary source names.

Output methods

  • toJSON() returns the version 3 source-map object;
  • toString() returns its compact JSON representation;
  • base64Encode() returns the UTF-8 JSON as base64;
  • inlineMappingUrl() returns the complete //# sourceMappingURL=... comment;
  • gen() returns the underlying SourceMapGenerator.

_mappings() is retained for compatibility and returns a diagnostic snapshot. Code should prefer toJSON() because underscore-prefixed internals are not a stable extension point in the underlying source-map project.

TypeScript

The package includes declarations for the callable export and Generator:

import inlineSourceMap = require('@stackline/inline-source-map');

const generator: inlineSourceMap.Generator = inlineSourceMap({
  file: 'bundle.js'
});

Browser bundles

Bundle the package with Browserify, esbuild, Rollup, Vite, or webpack. The package's browser field selects a prebuilt CommonJS entry that contains only the generator path and uses the browser's global URL. The base64 path uses Buffer when available and standard TextEncoder plus btoa in browsers. No browser global is installed by the package.

Compatibility

The JavaScript runtime supports Node.js 12 and newer. Development tooling uses Node.js 20.19 or newer. See COMPATIBILITY_CONTRACT.md for the exact preserved behaviors and MIGRATION.md for alias installation.

Release evidence

The release gate verifies:

  • 14 focused regression tests;
  • five differential compatibility scenarios against [email protected];
  • 100% line, statement, and function coverage;
  • Node.js 12, 14, 16, 18, 20, 22, and 24;
  • TypeScript 3.9, 4.7, 4.9, 5.9, 6.0, and 7.0;
  • CommonJS, ESM, browser, packed install, publint, and type export checks.

The interactive documentation playground runs the production browser bundle and exposes the generated Source Map v3 JSON.

Trust and maintenance

  • Every release is built from the public repository.
  • CI validates runtime compatibility, types, package exports, and clean installs.
  • Security reports use the private process in SECURITY.md.
  • License and upstream attribution remain in LICENSE, NOTICE, and THIRD_PARTY_LICENSES.md.

Provenance

This is an independent maintained fork of Thorsten Lorenz's MIT-licensed inline-source-map. The original copyright and license text are preserved in LICENSE, with additional attribution in NOTICE.