Naan and Paneer Makhani
Introducing npm Teams! Private packages + team management tools.Learn more »

powerwalker

0.1.1 • Public • Published

Power Walker

Power Walker

version travis AppVeyor downloads

Walk directories recursively


"All truly great thoughts are conceived by walking" – Friedrich Nietzsche

Installation

npm install powerwalker

Usage

const walk = require('powerwalker');
 
let files = await walk('path/to/walk');

API

walk(dir, options)

Type: Promise
Returns: Array

List all files and directories in dir recursively.

dir

Type: String

A directory path to walk recursively.

options

Type: Object
Default: { maxdepth: Infinity, flatten: true, filesonly: false }

Optional options object.

options.maxdepth

Type: Number
Default: Infinity

Max number of directories to walk before stopping.

options.flatten

Type: Boolean
Default: true

Option to flatten the output to a 1D array.

options.filesonly

Type: Boolean
Default: false

Exclude directories from result.

options.relative

Type: Boolean
Default: true

Return relative paths, or absolute paths.

options.cwd

Type: String
Default: '.'

Custom working directory. All paths are relative to this.

License

MIT © Terkel Gjervig

Install

npm i powerwalker

DownloadsWeekly Downloads

15

Version

0.1.1

License

MIT

Unpacked Size

122 kB

Total Files

18

Last publish

Collaborators

  • avatar