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

metro-file-map

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-file-map

[Experimental] - 🚇 File crawling, watching and mapping for Metro

  • 0.73.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
decreased by-8.51%
Maintainers
2
Weekly downloads
 
Created

What is metro-file-map?

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.

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

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);

Other packages similar to metro-file-map

FAQs

Package last updated on 26 Oct 2022

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