Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/actionify/src/deps/globber.ts>isJunk

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
function isJunk
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']

Parameters

filename: string