JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2071991
  • Score
    100M100P100Q189792F
  • License MIT

Get an array of recursive directory contents

Package Exports

  • walk-sync

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (walk-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-walk-sync

Return an array containing all recursive files and directories under a given directory, similar to Unix find. Does not follow symlinks. Bare-bones, but very fast.

Not to be confused with node-walk, which has both an asynchronous and a synchronous API.

Installation

npm install --save walk-sync

Usage

var walkSync = require('walk-sync');
var paths = walkSync('foo')

Given foo/one.txt and foo/subdir/two.txt, paths will be the following array:

['one.txt', 'subdir/', 'subdir/two.txt']

Note that directories come before their contents, and have a trailing slash.

Background

walkSync(baseDir) is a faster substitute for

glob.sync('**', {
  cwd: baseDir,
  dot: true,
  mark: true,
  strict: true
})