Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metro-source-map

Package Overview
Dependencies
Maintainers
2
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-source-map

🚇 Source map generator for Metro.

  • 0.81.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7M
decreased by-16.86%
Maintainers
2
Weekly downloads
 
Created

What is metro-source-map?

The metro-source-map npm package is a component of the Metro bundler, primarily used in React Native applications for handling and transforming source maps. Source maps are files that provide a way to map code within a compressed file back to its original position in a source file. This is especially useful for debugging purposes in a development environment.

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

Source Map Generation

Generate a source map from raw mappings. This feature is crucial for creating source maps that help in debugging by mapping the transformed code back to the original source code.

const { fromRawMappings } = require('metro-source-map');
const mappings = [{
  generated: { line: 1, column: 5 },
  original: { line: 1, column: 5 },
  source: 'source.js'
}];
const sourceMap = fromRawMappings(mappings).toString();

Source Map Composition

Compose multiple source maps into a single source map. This is useful when dealing with transformations or optimizations that occur in multiple stages, allowing for a unified source map that reflects all changes.

const { composeSourceMaps } = require('metro-source-map');
const firstMap = { version: 3, sources: ['foo.js'], names: [], mappings: 'AAAA' };
const secondMap = { version: 3, sources: ['foo.js'], names: [], mappings: 'BBBB' };
const composedMap = composeSourceMaps(firstMap, secondMap);

Other packages similar to metro-source-map

FAQs

Package last updated on 14 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc