Skip to content

devdoomari3/clearFolder

Repository files navigation

Codacy Badge

Clear-folder: clears files/folders with rules

usage

  • see __tests__/clearfolder.spec.ts file
const clearRules: ClearRule[] = [
  KEEP(m.folder('toKeep')),
  DEL(m.folder('toDelWithKeep'), [
    KEEP(m.folder('toKeep')),
  ]),
  DEL(m.folder('toDelWithNestedKeep'), [
    KEEP(m.nested(m.file('toSurvive.txt'))),
  ])
]
await clearFs({
  fullPath: fixturePath,
  clearRules,
  action: ACTIONS.DELETE,
})

License

Do whatever you like (copy/fork/resell as-is😒/...) , except:

  • sue me for bugs
  • forget to link to this repo as the original / attribute

About

clears directories based on rule-sets

Resources

Stars

Watchers

Forks

Packages

No packages published