junk
Filter out system junk files like .DS_Store and Thumbs.db
Last updated a year 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 junk

Usage

const {promisify} = require('util');
const fs = require('fs');
const junk = require('junk');

const pReaddir = promisify(fs.readdir);

(async () => {
	const files = await pReaddir('some/path');

	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 junk files.

License

MIT © Sindre Sorhus

Current Tags

  • 3.1.0                                ...           latest (a year ago)

13 Versions

  • 3.1.0                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           6 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.2                                ...           7 years ago
  • 0.2.1                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 992
This Week 1,910
This Month 5,451
Last Day 918
Last Week 5,433
Last Month 20,573
Dependencies (0)
None
Dev Dependencies (3)
Dependents (150)

Copyright 2014 - 2017 © taobao.org |