Thanks to visit codestin.com
Credit goes to github.com

Skip to content

seppevs/rmot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rmot

Remove Older Than

An async function that removes all files of a directory older than a given date

Build Status Coverage Status NPM Downloads Dependencies Known Vulnerabilities

Installation

$ npm install rmot --save

Example

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);
})();

About

Remove all files older than a certain date

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published