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/combine-source-map

v1.0.5

Published

Maintained combine-source-map-compatible combiner with synchronous APIs, modern mappings, and defensive parsing

Downloads

572

Readme

@stackline/combine-source-map

Maintained combine-source-map-compatible combiner with synchronous APIs, modern mappings, and defensive parsing.

npm version license GitHub repository Docs Reddit community

Documentation | npm | Issues | Repository

Current package version: 1.0.5


Why this package?

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

A maintained, synchronous, drop-in-compatible continuation of combine-source-map.

It combines generated files and their inline source maps into one map while preserving the established CommonJS API:

  • create(file?, sourceRoot?)
  • combiner.addFile(options, offset?)
  • combiner.base64()
  • combiner.comment()
  • removeComments(source)

Why this package

The upstream [email protected] release dates from 2017 and depends on older source-map helpers. This package keeps the familiar synchronous contract while modernizing map traversal, comment parsing, path handling, typings, browser packaging, and release verification.

Key properties:

  • synchronous base64() and comment() return values;
  • CommonJS and native ESM entry points;
  • TypeScript declarations compatible with TypeScript 3.9 and newer;
  • Node.js 12 through current releases;
  • POSIX, Windows drive, UNC, and URI source paths;
  • linear-time source-map comment discovery inherited from @stackline/convert-source-map;
  • safe handling of source names such as __proto__, prototype, and constructor;
  • no global memoization cache.

Trust and maintenance

  • Every release is built from the public repository.
  • CI validates runtime compatibility, types, package exports, clean installs, dependency signatures, and bounded malformed-input behavior.
  • Security reports use the private process in SECURITY.md.
  • Original MIT attribution remains in LICENSE, NOTICE, and THIRD_PARTY_LICENSES.md.

Project origin

This is an independent continuation and is not affiliated with the original maintainers. It preserves the upstream MIT license and attribution. See NOTICE and THIRD_PARTY_LICENSES.md.

Compatibility

| Item | Value | | --- | --- | | Package | @stackline/[email protected] | | Node.js runtime | >=12 | | CommonJS / primary entry | ./index.js | | Type declarations | ./index.d.ts |

Compatibility at a glance

| Item | Value | | :--- | :--- | | Package | @stackline/[email protected] | | API baseline | [email protected] | | Runtime | Node.js 12+, browser bundles | | Modules | CommonJS and native ESM | | Types | First-party TypeScript declarations | | Runtime dependencies | Four, including two Stackline compatibility aliases |

The normal behavior of [email protected] is covered by differential tests. Intentional corrections are listed in COMPATIBILITY_CONTRACT.md, and migration options are in MIGRATION.md.

Installation

Install

Use the scoped package directly:

Usage

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

For an existing project that imports combine-source-map, use an npm alias:

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

Existing source code can remain unchanged:

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

const combiner = combine.create('bundle.js');

combiner
  .addFile({
    sourceFile: 'src/one.js',
    source: 'console.log(1);'
  })
  .addFile({
    sourceFile: 'src/two.js',
    source: 'console.log(2);'
  }, { line: 1 });

const base64 = combiner.base64();
const comment = combiner.comment();

Native ESM is also supported:

import combine, { create, removeComments } from '@stackline/combine-source-map';

const map = create('bundle.js')
  .addFile({ sourceFile: 'input.js', source: 'export default 1;' })
  .comment();

Security

Security hardening is tested against dangerous property names and large, malformed comment input. No CVE or GHSA is claimed for this package without a matching public advisory. Report suspected vulnerabilities privately as described in SECURITY.md.

API Surface

API

create(file?, sourceRoot?)

Creates a combiner. file defaults to generated.js.

combiner.addFile(options, offset?)

Adds a generated source file. options contains sourceFile and source. When source includes an inline map with embedded source content, its original mappings are rebased and retained. Otherwise, identity mappings are generated.

offset.line and offset.column default to zero.

combiner.base64()

Returns the combined source map as a base64 string. The return value is always synchronous.

combiner.comment()

Returns an inline sourceMappingURL comment. The return value is always synchronous.

removeComments(source)

Removes inline and external source-map comments while leaving comment-like text inside JavaScript strings untouched.

Local Development

git clone https://github.com/alexandroit/stackline-combine-source-map.git
cd stackline-combine-source-map
npm ci
npm run test

Release tooling uses Node.js 24.20.0 and npm 11.19.0. The consumer runtime contract remains the one documented above.

Consumer Smoke Test

Run the repository's existing consumer/package check after installing development dependencies:

npm run test:install

Release Checklist

Release evidence

The release gate verifies:

  • 13 focused regression tests;
  • five differential compatibility scenarios against [email protected];
  • 99%+ line coverage and 100% function coverage;
  • bounded malformed-comment processing;
  • 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, native ESM, browser, packed install, publint, and type checks.

The interactive documentation playground runs the production browser bundle and decodes its combined map for inspection.

Run npm run test and inspect the package contents before release. Publish a new version through the GitHub Actions publishing workflow, using the SHA-512 digest of the reviewed tarball. Verify the exact published version, tarball integrity, and npm provenance after the run.

License

MIT

Credits and original authors

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

Community and Links

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.