Created
August 20, 2019 08:06
-
-
Save Cykelero/d5ae98ddeff5b9fb958acd00112253d2 to your computer and use it in GitHub Desktop.
A very simple script: written in Tasklemon, and written with the built-in Node.js APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tasklemon | |
home.children.forEach(child => { | |
if (child.extension === 'tmp') child.delete(); | |
}); | |
// Node.js | |
const fs = require('fs'); | |
const os = require('os'); | |
const path = require('path'); | |
const folderPath = os.homedir(); | |
fs.readdirSync(folderPath).forEach(childName => { | |
if (path.parse(childName).ext === '.tmp') { | |
const absolutePath = path.join(folderPath, childName); | |
fs.unlinkSync(absolutePath); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment