# caffeine-source-map

> Caffeine.SourceMap

Latest version **2.0.10** (published 2025-11-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install caffeine-source-map
pnpm add caffeine-source-map
yarn add caffeine-source-map
bun add caffeine-source-map
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.10 |
| Published | 2025-11-07 |
| First published | 2018-06-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 63.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Shane Brinkman-Davis Delamore |
| Maintainers | shanebdavis |

## Links

- npm: https://www.npmjs.com/package/caffeine-source-map
- Repository: https://github.com/caffeine-suite/caffeine-suite
- Issues: https:/github.com/caffeine-suite/caffeine-suite/issues
- npm.io page: https://npm.io/package/caffeine-source-map

## Dependencies (3)

- [caffeine-eight](https://npm.io/package/caffeine-eight.md) ^3.0.5
- [art-standard-lib](https://npm.io/package/art-standard-lib.md) ^1.73.1
- [neptune-namespaces-runtime](https://npm.io/package/neptune-namespaces-runtime.md) ^3.2.8

## Recent versions

- 2.0.10 (latest) — 2025-11-07
- 2.0.9 — 2024-08-16
- 2.0.8 — 2024-05-30
- 2.0.7 — 2020-10-23
- 2.0.6 — 2020-10-23
- 2.0.5 — 2020-09-26
- 2.0.4 — 2020-09-26
- 2.0.3 — 2020-09-12
- 2.0.2 — 2020-08-29
- 2.0.1 — 2020-08-23
- 2.0.0 — 2018-07-30
- 1.1.0 — 2018-07-21
- 1.0.2 — 2018-06-08
- 1.0.1 — 2018-06-04
- 1.0.0 — 2018-06-04

## README

# Caffeine.SourceMap

* Primary purpose: Generate source maps
* Secondary purposes:
  * Consume source-maps in a simple-to-understand way, primarily for validation. The *source-map* npm is probably a faster choice for consuming source-maps for real-world uses, but it's clunky.
* Future:
  * Source-map validation
  * Source-map visualization

### Install

```coffeescript
npm install caffeine-source-map
```

### Based on

- source-map npm: https://github.com/mozilla/source-map
- SourceMap Spec: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k

### Why rewrite `source-map npm `?

- Performance:
  - `source-map npm`'s generator isn't very performance-optimized. It creates at least 3 objects per sourcemap segment generated. CaffeineSourceMap generates no extra objects beyond those needed to create the SourceNode tree.
     - CaffeineScript generates a structure of nested arrays. Using source-map, I have to compactFlatten them first, which means creating more objects and iterating over the contents twice. If a SourceNode is JUST a string, no need to create an array.
  - Since CaffeineSourceMap works with sourceIndexes, if we don't actually generate a sourceMap, we never have to compute the lines and columns and yet we can still use CaffeineSourceMap to output the generated code.
- Simplicity:
  - As a single-file compiler, we can dramatically simplify the API.
  - `CaffeineSourceMap.SourceNode` allows `@children` to be:
     - string
     - sourceNode
     - null / undefined
     - or an arbitrarily, nested array-structure of the above.
  - CaffeineSourceMapWe works in sourceIndex-space most the time. Code-generation doesn't have to think about lines and columns. Only CaffeineSourceMap needs to actually worry about lines and columns.
- Consistency:
  - both column AND LINE are 0-based, same as the SourceMapV3 standard. I had so many off-by-one bugs with `source-map npm`!

---
_Source: https://npm.io/package/caffeine-source-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
