node-all-directories
TypeScript icon, indicating that this package has built-in type declarations

13.0.0 • Public • Published

node-all-directories

v13 (current version)

Dependencies

Features

  • Get directories in an array that mimics directory structure.
  • Get files.
  • Find directories.

Installation

npm i node-all-direcotories

Usage

Walk through file system

var Directory = require('node-all-directories').Directory
var dirs = new Directory()

dirs.walk(/* depth = 1 */)

// dirs.children contains directories on root dir.

Find directories

const D = require('node-all-directories').Directory
const dirs = new D()
const options = {depth: 4}
const whenFound = (root, tag) => {
    console.log(`root: ${root}, found: ${tag}`)
}
const findThese = ['usr', 'home', 'Movies', 'Documents']
dirs.find(findThese, whenFound, options)

If options.depth to find is greater than dirs.depth, then we walk.

IMPORTANT: Callback is necessary to get the output of find.

License

MIT

  • © 2018 Git Faf
  • © 2021 Anubhav

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 13.0.0
    0
    • latest

Version History

Package Sidebar

Install

npm i node-all-directories

Weekly Downloads

0

Version

13.0.0

License

MIT

Unpacked Size

28.3 kB

Total Files

26

Last publish

Collaborators

  • iamanubhavsaini
  • sainianubhav