0.1.1 • Published 2 years ago

fs-aux v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

fs-aux is a minimalistic modern fs API extension, not a drop-in, just very few extra "missing" functions.

  • Does not monkey-patch anything
  • Uses native fs/promises (with the ups and the downs)
  • Only async functions
  • Uses fast-glob for glob
  • ESM only

API

import { saferRemove, glob, pathExists} from 'fs-aux';

// Will use fast-glob and then sort file paths 
let tsFiles = await glob('src/**/*.ts');

// Will remove only if child of ./ (by default) or throw error
await saferRemove('dist/');

// Will test if path "exists" (use fs/promises access and map try/catch to boolean
let distExists = await pathExists('dist/')