Socket
Socket
Sign inDemoInstall

@beyond-js/finder

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyond-js/finder

A powerful and flexible file finder utility for Node.js applications.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

@beyond-js/finder

A powerful and flexible file finder utility for Node.js applications.

Installation

npm install @beyond-js/finder

Usage

const { Finder, ConfigurableFinder, FinderCollection } = require('@beyond-js/finder');

// Basic usage with Finder
const finder = new Finder('/path/to/search', {
	includes: ['*.js', 'src/**/*.ts'],
	excludes: ['node_modules', 'dist'],
	filename: 'config',
	extname: ['.json', '.yaml']
});

finder.on('file.change', file => {
	console.log('File changed:', file);
});

// Using ConfigurableFinder
const configurableFinder = new ConfigurableFinder(watcherInstance);
configurableFinder.configure('/path/to/search', {
	includes: ['**/*.js'],
	excludes: ['node_modules']
});

// Using FinderCollection
class MyCollection extends FinderCollection {
	constructor(watcher) {
		super(watcher, MyItemClass);
	}
}

const collection = new MyCollection(watcherInstance);
collection.configure('/path/to/search', {
	includes: ['**/*.config.js']
});

collection.ready.then(() => {
	for (const [key, item] of collection) {
		console.log(key, item);
	}
});

API

Finder

  • constructor(path: string, specs: object)
  • on(event: string, callback: function): Listen for file changes

ConfigurableFinder

  • constructor(watcher: object)
  • configure(path: string, specs: object): Set up the finder configuration

FinderCollection

  • constructor(watcher: object, Item: class)
  • configure(path: string, specs: object): Set up the collection configuration
  • ready: Promise that resolves when the collection is ready

Features

  • Flexible file searching with include/exclude patterns
  • File watching capabilities
  • Configurable finder for dynamic search configurations
  • Collection support for managing groups of found items
  • Asynchronous processing with Promise support

License

MIT © [BeyondJS]

Keywords

FAQs

Package last updated on 14 Sep 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