Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kbismark/dir-bit
Asynchronously removes directories and files in node js.
https://github.com/kbismark/dir-bit
async-delete async-remove delete-files directory filesystem fs node-fs nodejs remove remove-directory
Last synced: 30 days ago
JSON representation
Asynchronously removes directories and files in node js.
- Host: GitHub
- URL: https://github.com/kbismark/dir-bit
- Owner: KBismark
- License: mit
- Created: 2021-10-19T17:34:22.000Z (about 3 years ago)
- Default Branch: fun
- Last Pushed: 2021-10-21T17:18:42.000Z (about 3 years ago)
- Last Synced: 2024-11-10T04:36:44.331Z (about 1 month ago)
- Topics: async-delete, async-remove, delete-files, directory, filesystem, fs, node-fs, nodejs, remove, remove-directory
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dir-bit
Asynchronously removes directories and files in nodejs. This module will help you remove or delete an entire directory or many files in just one line code.## Methods
- `removeDir` This method removes an entire directory asynchronously. It takes two arguments: `path` and `callback`- `deleteFiles` This method asynchronously deletes files in a directory. It takes three arguments: `path`, `filesArr` and `callback`
- `override_fs` This module uses the `fs` module to perform operations. Use this method to change that behavior.
> ```js
> var dirbit = require("dir-bit");
> function callback(){};
>
> // Deletes "./unwanted-dir" and everything (direcotories, nested directories or files) in it.
> dirbit.removeDir("./unwanted-dir",callback); //callback is optional.
>
> // Deletes files in the filesArray from "./unwanted-dir".
> var filesArray = ["somefile.txt","anotherfile.png"];
> dirbit.deleteFiles("./unwanted-dir",filesArray,callback); //callback is optional.
>