Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    directory-streampublic

    Directory Stream

    Build Status

    This module provides a streaming interface for scanning directories. It is capable of scanning a single level of a directory as well as recursively scanning directories. It also ships with async and sync flavors.

    Scanning a single level directory

    var directoryStream = require("directory-stream")
    var eventStream     = require("event-stream")
     
    lineStream = eventStream.map(function(file, next) {
      next(false, file + "\n")
    }));
     
    directoryStream("./target/directory").pipe(lineStream).pipe(process.stdout)

    Scanning a nested directories recursively

    var directoryStream = require("directory-stream")
    var eventStream     = require("event-stream")
     
    lineStream = eventStream.map(function(file, next) {
      next(false, file + "\n")
    }));
     
    directoryStream.recursive("./target/directory").pipe(lineStream).pipe(process.stdout)

    Keywords

    none

    install

    npm i directory-stream

    Downloadsweekly downloads

    3

    version

    0.1.1

    license

    none

    last publish

    collaborators

    • avatar