Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

directory-crawler

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

directory-crawler

The directory crawler library for Node.JS

latest
Source
npmnpm
Version
0.0.6
Version published
Weekly downloads
16
6.67%
Maintainers
1
Weekly downloads
 
Created
Source

directory-crawler

The directory crawler library by Node.JS

Notice

Currently, this library is under development and changes to the API may occur at any time.

install

npm install directory-crawler

function crawlingDirStream(depth=Infinity, concurrency, ...dirPaths) : stream(dirent)

  • depth - Number (0 ~ Infinity)
  • concurrency - Number
  • dirPaths - String Array
  • return stream (Dirent)
    • name - String
    • path - String - absolute parent directory path
    • [Symbol(type)] - Symbol - file type

usage

import { crawlingDirStream } from 'directory-crawler'

const lasttime = process.hrtime.bigint();

for await (const d of crawlingDirStream(Infinity, Infinity, '../')) {
  //   console.log(d);
}

console.log(process.hrtime.bigint() - lasttime);

crawlingDir(depth, concurrency, dir): Promise(Array(Dirent))

  • depth - Number (0 ~ Infinity)
  • concurrency - Number
  • dirPaths - String Array
  • return Promise(Array(Dirent))
    • name - String
    • path - String - absolute parent directory path
    • [Symbol(type)] - Symbol - file type

usage

import { crawlingDir } from 'directory-crawler'

const lasttime = process.hrtime.bigint();

crawlingDir(Infinity, Infinity, '../').then((files) => {
  console.log(files.length);
  console.log(process.hrtime.bigint() - lasttime);
});

MIT License Copyright (c) 2021 HyunJae Lee

Keywords

directory

FAQs

Package last updated on 10 Jul 2021

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