folder-reader
recursively stream a directory of files
Last updated 3 years ago by sethvincent .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install folder-reader 
SYNC missed versions from official npm registry.

folder-reader

Recursively stream a directory of files.

npm travis standard conduct

About

Recursively read all files/directories in a set of directories.

Creates a stream that outputs objects with file content and metadata.

Example item in the stream:

{
  basename: 'index.js',
  relname: 'tests/index.js',
  root: '/Users/sdv/workspace/sethvincent/folder-reader',
  filepath: '/Users/sdv/workspace/sethvincent/folder-reader/tests/index.js',
  stat: [fs.Stat Object],
  type: 'file' // or 'directory',
  file: '' // the contents of the file
}

Based on the folder-walker module.

Install

npm install --save folder-reader

Usage

var path = require('path')
var reader = require('folder-reader')

var dir = path.join(__dirname, 'docs')
reader(dir).on('data', console.log)

Using alternate fs implementations

You can use this module with alternate fs implementations like hyperdrive by passing the alternate fs as an option:

var reader = require('folder-reader')
var hyperdrive = require('hyperdrive')

var drive = hyperdrive('./drive')

reader('/some/dir', { fs: drive })

See a more detailed example of using this module with hyperdrive.

Documentation

Examples

Contributing

Contributions are welcome! Please read the contributing guidelines first.

Conduct

It is important that this project contributes to a friendly, safe, and welcoming environment for all. Read this project's code of conduct

Changelog

Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Contact

License

ISC

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

4 Versions

  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (8)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |