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
$ 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

Maintainers (1)
Downloads
Today 23
This Week 1,103
This Month 3,253
Last Day 103
Last Week 1,052
Last Month 4,120
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2017 © taobao.org |