fs-directory-stream

1.0.1 • Public • Published

fs-directory-stream

Streaming fs.readdir.

npm install fs-directory-stream

Build Status

Useful if your directory contains a ton of directories and you don't want to read them all into ram at once.

Usage

var createDirectoryStream = require('fs-directory-stream')

createDirectoryStream('/home/maf/dev/node_modules')
  .on('data', data => console.log(data))
  .on('end', () => console.log('(no more data)'))

Uses uv_fs_scandir_next behind the scenes to perform the streaming readdir.

API

var readableStream = createDirectoryStream(path)

Make a new stream of directory entries. Will emit an error if path doesn't exist, etc.

Every data event is the string name of a directory entry.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i fs-directory-stream

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mafintosh