Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
metro-source-map
Advanced tools
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.
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);
source-map is a comprehensive library for dealing with source maps. It allows for generation, parsing, and manipulation of source maps. Compared to metro-source-map, source-map provides a more extensive set of features for general use cases beyond the React Native ecosystem.
source-map-js is a fork of the original source-map library, optimized for performance. It shares similar functionalities with metro-source-map but is designed to be faster and more efficient in handling source maps in various environments.
FAQs
🚇 Source map generator for Metro.
The npm package metro-source-map receives a total of 2,648,002 weekly downloads. As such, metro-source-map popularity was classified as popular.
We found that metro-source-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.