New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

scan-directory

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scan-directory

[![NPM](https://nodei.co/npm/scan-directory.png?downloads=true&stars=true)](https://nodei.co/npm/scan-directory/)

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
decreased by-50.36%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

Blazing fast directory scan. Uses async/await underneath, doing all the stuff in async and parallel way.

#Usage

import scan, {forExt} from 'scan-directory';

const list = await scan(
   directory: string, 
   acceptFunction, 
   [rejectFunction=skipNodeModules]
);

For example

const list = await scan(
  __dirName,    // where 
  forExt('js'), // what
  (fileName) => fileName.match(somePattern)) // what NOT

Where acceptFunction and rejectFunction - (fileName:string, stat) => boolean.

Node 8?

scan-directory is bundled for node 10.

For older node versions use scan-directory/cjs entry point (no async/await)

FAQs

Package last updated on 23 Oct 2019

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