recursive-readdir-sync
NodeJS library to recursively read a directory path's contents synchronously
Last updated 5 years ago by complexcarb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install recursive-readdir-sync 
SYNC missed versions from official npm registry.

recursive-readdir-sync

NodeJS library to recursively read a directory path's contents synchronously

A simple Node module for synchronously listing all files in a directory, or in any subdirectories.

It does not list directories themselves.

This library uses synchronous filesystem calls. That means this library uses BLOCKING calls. Keep that in mind when using it.

Install

npm install recursive-readdir-sync

Example

var recursiveReadSync = require('recursive-readdir-sync')
  , files
  ;

try {
  files = recursiveReadSync('/your/path/here');
} catch(err){
  if(err.errno === 34){
    console.log('Path does not exist');
  } else {
    //something unrelated went wrong, rethrow
    throw err;
  }
}

console.log('Files array:', files);

//loop over resulting files
for(var i = 0, len = files.length; i < len; i++){
  console.log('Found: %s', files[i]);
}

Current Tags

  • 1.0.6                                ...           latest (5 years ago)

7 Versions

  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 8
This Week 191
This Month 326
Last Day 31
Last Week 226
Last Month 1,144
Dependencies (0)
None
Dev Dependencies (3)
Dependents (179)

Copyright 2014 - 2016 © taobao.org |