junk
Filter out system junk files like .DS_Store and Thumbs.db
Last updated 2 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install junk 
SYNC missed versions from official npm registry.

junk Build Status

Filter out system junk files like .DS_Store and Thumbs.db

Install

$ npm install --save junk

Usage

const fs = require('fs');
const junk = require('junk');

fs.readdir('some/path', (err, files) => {
	console.log(files);
	//=> ['.DS_Store', 'test.jpg']

	console.log(files.filter(junk.not));
	//=> ['test.jpg']
});

API

junk.is(filename)

Returns true if filename matches a junk file.

junk.not(filename)

Returns true if filename doesn't match a junk file.

junk.regex

Regex used for matching.

License

MIT © Sindre Sorhus

Current Tags

  • 2.1.0                                ...           latest (2 years ago)

11 Versions

  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           6 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 5
This Week 5
This Month 3,140
Last Day 67
Last Week 1,447
Last Month 5,441
Dependencies (0)
None
Dev Dependencies (2)
Dependents (109)

Copyright 2014 - 2016 © taobao.org |