del-expired-file
v1.0.0
Published
delete expired file
Downloads
4
Readme
del-expire-file
delete expired file。
Installation
npm install del-expired-file --save
Usage
'use strict';
const path = require('path');
const delExpiredFile = require('del-expired-file');
const filesPath = path.resolve('./');
delExpiredFile({
filePath: filesPath,
ext: 'txt',
expiredType: 'ctime',
date: '5s',
})
.then((res) => {
console.log('delete file', res);
});
// ['a.txt', 'b.txt']
Api
options
<Object>
filePath
<string>
: default ispwd
ext
<string>
expiredType
<string>
: [ctime
,atime
,mtime
], default isctime
date
string
: [3d
,5h
,6m
,30s
], default is3d