@coderevivehq/source-map-url
v0.4.2
Published
Tools for working with sourceMappingURL comments.
Maintainers
Readme
Overview
source-map-url provides small CommonJS, AMD, and browser helpers for finding, reading, removing, and preserving JavaScript and CSS sourceMappingURL comments. It is intended for compatibility-sensitive tooling that needs the original package's four helper methods.
Maintained by CodeRevive
This maintained continuation is published by CodeRevive. Security patches are our highest priority. We also review bug reports, feature requests, and suggestions from the community.
The project is based on the original source-map-url repository and its contributors.
Quick links
- Overview
- Maintained by CodeRevive
- Installation & setup
- Documentation
- Usage
- Migration
- Contributing
- Security & support
- Credits & license
Installation & setup
npm install @coderevivehq/source-map-urlThe npm package supports Node.js 18 and later. The distributed UMD module can also be loaded with AMD or as the browser global sourceMappingURL.
Documentation
Detailed documentation is maintained in the docs/ directory. Start with the documentation overview, then use the Usage guide, API reference, Examples, Migration guide, and Troubleshooting guide.
Usage
var sourceMappingURL = require("@coderevivehq/source-map-url")
var code = "console.log('hello')\n//# sourceMappingURL=app.js.map"
sourceMappingURL.getFrom(code)
// "app.js.map"
code = sourceMappingURL.removeFrom(code)The package also provides existsIn and insertBefore. See the API reference for their contracts and edge cases.
Migration
Replace the original package name in the dependency and import. The four helper methods keep their established signatures. See the Migration guide for the exact change and the corrected handling of comment-like text inside strings.
Contributing
Bug reports, focused improvements, and documentation updates are welcome through GitHub issues and pull requests. Please run npm test before submitting a change.
Security & support
Report security concerns privately through the repository's Security page. For usage questions and ordinary bugs, open a GitHub issue with a minimal reproduction when possible.
Credits & license
This project is a maintained continuation of lydell/source-map-url, originally created by Simon Lydell. Original code and CodeRevive-authored changes are licensed under the MIT License. Original copyright notices are retained in LICENSE.
