https://github.com/seppevs/rmot
Remove all files older than a certain date
https://github.com/seppevs/rmot
Last synced: 3 months ago
JSON representation
Remove all files older than a certain date
- Host: GitHub
- URL: https://github.com/seppevs/rmot
- Owner: seppevs
- License: mit
- Created: 2019-06-05T16:24:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T08:23:30.000Z (over 6 years ago)
- Last Synced: 2025-02-23T22:07:09.699Z (over 1 year ago)
- Language: JavaScript
- Size: 318 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# rmot
Remove Older Than
An async function that removes all files of a directory older than a given date
✨ [](https://travis-ci.org/seppevs/rmot) [](https://coveralls.io/r/seppevs/rmot) [](https://www.npmjs.org/package/rmot) [](https://www.npmjs.org/package/rmot) [](https://david-dm.org/seppevs/rmot) [](https://snyk.io/test/github/seppevs/rmot) ✨
## Installation
```bash
$ npm install rmot --save
```
## Example
```javascript
const rmot = require('rmot');
(async () => {
// Removes all files in `/path/to/some/dir` that were created before '2019-06-05T19:48:48.049Z'
const result = await rmot('/path/to/some/dir', new Date('2019-06-05T19:48:48.049Z'));
// The resolved value will contain a list of fileNames that were removed
console.log(result);
})();
```