开发者社区> 镜像站> NPM> spider-stream
spider-stream
spider a directory and turn it into a stream
Last updated 6 years ago by cwmma .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install spider-stream 
SYNC missed versions from official npm registry.

spider stream

npm install spider-stream
var spiderStream = require('spiderStream');
spiderStream('path', ignore).pipe(...);

Give it a path and it will give you a stream of paths that are contained.

If you have a folder called foo, with a bar file and a baz folder in there with a bop file it will be called with foo/bar and foo/baz/bop.

The second argument ignore is an optional way to specify files to ignore, currently the default is to ignore any file or folder that:

  • is named .git
  • is named .DS_Store
  • ends in tilda

Note: expect the default list to increase.

If you pass false then nothing is ignored, passing an array replaces the default one ['.git', '.DS_Store', '*~'] filenames are matched using minimatch, but at the moment, only the name not the full path.

If you pass a function then it will be called on each file with 2 arguments, the filename and the full path, return a truthy value if it should be ignored.

Current Tags

  • 0.2.2                                ...           latest (6 years ago)

4 Versions

  • 0.2.2                                ...           6 years ago
  • 0.2.1                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)