Move system junk files to the trash (recursively)
$ npm install --save trash-junk
const trashJunk = require('trash-junk');
trashJunk(__dirname).then((files) => {
console.log(files);
});
// => [ '.DS_Store', '__MACOSX' ]
Returns a Promise
input
is a directory you wish to scan
To install the trash-junk
command, run:
$ npm install --global trash-junk-cli
const junk = [
'.DS_Store',
'.AppleDouble',
'.LSOverride',
'Icon\r',
'._test',
'.Spotlight-V100',
'.Spotlight-V100/Store-V2/C6DBF25D-81D4-4B57-907E-B4A555E72C90/0.directoryStoreFile',
'.Trashes',
'__MACOSX',
'test~',
'Thumbs.db',
'ehthumbs.db',
'Desktop.ini',
'npm-debug.log',
'.test.swp'
]
- trash-junk-cli - Move system junk files to the trash (recursively)
- junk by Sindre Sorhus - Filter out system junk files like .DS_Store and Thumbs.db
MIT © Sergey Lysenko