junk
Filter out system junk files like .DS_Store and Thumbs.db
Last updated 7 days 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.0.0                                ...           latest (7 days ago)

12 Versions

  • 3.0.0                                ...           7 days ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           5 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 10
This Week 10
This Month 7,433
Last Day 83
Last Week 3,436
Last Month 4,756
Dependencies (0)
None
Dev Dependencies (3)
Dependents (116)

Copyright 2014 - 2016 © taobao.org |