srcmap-cli-0.3.0 is not a library.
srcmap-cli
CLI tool to inspect, validate, compose, and manipulate source maps.
Agent-friendly with --json structured output on all commands and srcmap schema for runtime introspection.
Install
Commands
| Command | Description |
|---|---|
info |
Show source map metadata and statistics |
validate |
Validate a source map file |
lookup |
Find original position for a generated position |
resolve |
Find generated position for an original position |
decode |
Decode a VLQ mappings string to JSON |
encode |
Encode decoded mappings JSON back to a VLQ string |
mappings |
List all mappings with pagination |
concat |
Concatenate multiple source maps into one |
remap |
Compose/remap source maps through a transform chain |
symbolicate |
Symbolicate a stack trace using source maps |
scopes |
Inspect ECMA-426 scopes and variable bindings |
fetch |
Fetch a JS/CSS bundle and its source map from a URL |
sources |
List or extract original sources from a source map |
schema |
Describe all commands as JSON (for agent introspection) |
Usage
# Inspect a source map
# Validate
# Look up original position (0-based line:column)
# Look up with surrounding source context
# Reverse lookup
# Decode VLQ mappings
# List mappings with pagination
# Concatenate source maps
# Remap through upstream maps
# Symbolicate a stack trace
# Inspect ECMA-426 scopes
# Fetch a bundle and its source map from a URL
# List embedded original sources
# Extract all original sources to disk
# All commands support --json for structured output
# Introspect all commands and their arguments
Features
- Structured JSON output —
--jsonflag on all commands for machine-readable output - Agent introspection —
srcmap schemadescribes all commands, args, types, and flags as JSON - stdin support — use
-as file argument to read from stdin - Dry run —
--dry-runon mutating commands (concat,remap) to validate without writing - Input hardening — rejects control characters, path traversals, and percent-encoding in source names
- Output sandboxing — all file writes validated against the current working directory
- Remote fetching —
srcmap fetchdownloads bundles and source maps from URLs, resolvingsourceMappingURLautomatically - Source extraction —
srcmap sources --extractwrites embeddedsourcesContentto disk with directory structure - Context lines —
srcmap lookup --context Nshows surrounding original source around a mapped position - Structured errors — error codes (
IO_ERROR,PARSE_ERROR,NOT_FOUND,VALIDATION_ERROR,PATH_TRAVERSAL,INVALID_INPUT,FETCH_ERROR) in JSON mode
Part of srcmap
See also:
srcmap-sourcemap- Parser and consumersrcmap-generator- Source map buildersrcmap-remapping- Concatenation and compositionsrcmap-codec- VLQ encode/decode
License
MIT