Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpkn/folder-cleanup
A Nodejs plugin that helps you remove old files and folders
https://github.com/tpkn/folder-cleanup
Last synced: about 2 months ago
JSON representation
A Nodejs plugin that helps you remove old files and folders
- Host: GitHub
- URL: https://github.com/tpkn/folder-cleanup
- Owner: tpkn
- License: mit
- Created: 2017-12-05T22:23:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-26T20:35:40.000Z (about 7 years ago)
- Last Synced: 2024-11-11T05:28:53.276Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Folder Cleanup
Helps you remove old files and foldersA convenient way to rid of files and folders that are older than specified amount of time.
Cleanup function takes two arguments:
1. folder path
2. maximum file age (in milliseconds)## Usage
```javascript
const cleanup = require('folder-cleanup');let max_age = '5d';
let temp_uploads = '/usr/www/domain.me/temp_uploads';// Deleting files that were created later than 5 days ago
cleanup(temp_uploads, max_age);
```People who are feeling nauseous just thinking of how they will converting 90 weeks into milliseconds, could use already [built-in time converter](https://www.npmjs.com/package/string-to-ms).