Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
metro-file-map
Advanced tools
[Experimental] - 🚇 File crawling, watching and mapping for Metro
The metro-file-map npm package is a utility for managing and interacting with file systems, particularly useful in scenarios where you need to map, watch, and query files efficiently. It is often used in build systems and development tools to handle file operations in a performant manner.
File Mapping
This feature allows you to create a map of files, add files to the map, and retrieve the list of files. It is useful for keeping track of files in a project.
const { FileMap } = require('metro-file-map');
const fileMap = new FileMap();
fileMap.addFile('/path/to/file.js');
console.log(fileMap.getFiles());
File Watching
This feature enables you to watch a directory for changes. When a file in the directory changes, it triggers an event, allowing you to respond to file modifications in real-time.
const { FileWatcher } = require('metro-file-map');
const watcher = new FileWatcher('/path/to/watch');
watcher.on('change', (filePath) => {
console.log(`${filePath} has changed`);
});
File Querying
This feature allows you to query files based on patterns. It is useful for finding specific types of files within a directory, such as all JavaScript files.
const { FileQuery } = require('metro-file-map');
const query = new FileQuery('/path/to/query');
const jsFiles = query.findFiles('*.js');
console.log(jsFiles);
Chokidar is a highly efficient file watcher that can watch file system changes and trigger events. It is similar to metro-file-map's file watching feature but is more focused on watching and less on mapping and querying.
Glob is a package for matching files using patterns. It is similar to the file querying feature of metro-file-map but does not include file watching or mapping capabilities.
fs-extra extends the native Node.js file system module with additional methods. It provides some overlapping functionality with metro-file-map, such as file operations, but does not offer file watching or querying based on patterns.
🚇 File system crawling, watching and mapping for Metro.
Originally a fork of jest-haste-map
.
This entire package should be considered "experimental" for the time being - the API is considered internal and changes will not be semver-breaking.
If you need to rely on metro-file-map
APIs directly please
raise an issue to discuss your
use case.
FAQs
[Experimental] - 🚇 File crawling, watching and mapping for Metro
The npm package metro-file-map receives a total of 1,810,159 weekly downloads. As such, metro-file-map popularity was classified as popular.
We found that metro-file-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.