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