Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 847 Bytes

readme.md

File metadata and controls

31 lines (24 loc) · 847 Bytes

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