Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including powerwalker with all npm packages installed. Try it out:

var powerwalker = require("powerwalker")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

powerwalker v0.1.1

walk directories recursively

Power Walker

Power Walker

version travis AppVeyor downloads

Walk directories recursively

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


npm install powerwalker


const walk = require('powerwalker');

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


walk(dir, options)

Type: Promise
Returns: Array

List all files and directories in dir recursively.


Type: String

A directory path to walk recursively.


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

Optional options object.


Type: Number
Default: Infinity

Max number of directories to walk before stopping.


Type: Boolean
Default: true

Option to flatten the output to a 1D array.


Type: Boolean
Default: false

Exclude directories from result.


Type: Boolean
Default: true

Return relative paths, or absolute paths.


Type: String
Default: '.'

Custom working directory. All paths are relative to this.


MIT © Terkel Gjervig

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free