Skip to content

BriteSnow/node-fs-aux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/')

About

Minimalistic augmentation of the native fs/promises API

Resources

License

Stars

Watchers

Forks

Packages

No packages published