🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

source-map-url

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

source-map-url

Tools for working with sourceMappingURL comments.

0.4.1
latest
100

Supply Chain Security

100

Vulnerability

98

Quality

76

Maintenance

100

License

Repository has been archived by the owner.

Deprecated

Maintenance

The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.

Found 1 instance in 1 package

Version published
Weekly downloads
13M
0.94%
Maintainers
1
Weekly downloads
 
Created
Issues
2

What is source-map-url?

The source-map-url npm package is a utility for working with source map URLs. It allows you to extract, insert, or remove source map URLs within a file, typically JavaScript or CSS files. This can be useful for developers who need to manage source map links in their generated code.

What are source-map-url's main functionalities?

Extracting source map URL

This feature allows you to extract the source map URL from a string of code. The `getFrom` method returns the URL if it exists.

const sourceMapUrl = require('source-map-url');
const code = '/*# sourceMappingURL=/path/to/file.js.map */';
const extractedUrl = sourceMapUrl.getFrom(code);

Inserting source map URL

This feature enables you to insert a source map URL into a string of code. The `insertInto` method adds the specified URL at the end of the code.

const sourceMapUrl = require('source-map-url');
const code = 'function example() {}';
const newCode = sourceMapUrl.insertInto(code, '/path/to/file.js.map');

Removing source map URL

This feature is used to remove an existing source map URL from a string of code. The `removeFrom` method strips out the source map URL.

const sourceMapUrl = require('source-map-url');
const code = 'function example() {}\n/*# sourceMappingURL=/path/to/file.js.map */';
const newCode = sourceMapUrl.removeFrom(code);

Other packages similar to source-map-url

FAQs

Package last updated on 01 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts