import { isNotJunk } from "https://deno.land/x/globber@0.1.0/src/junk.ts";
Returns true
if filename
does not match a junk file.
Taken from https://github.com/sindresorhus/junk
Examples
This be used to find all junk files in a directory.
import { isNotJunk } from 'https://deno.land/x/globber/mod.ts';
const files: string[] = []
const notJunk: string[] = [];
for await (const file of Deno.readDir('some/path')) {
files.push(file.name);
if (isNotJunk(file.name)) {
notJunk.push(file.name);
}
}
console.log(notJunk);
//=> ['test.jpg']
console.log(files);
//=> ['test.jpg', '.DS_Store']