Last active
September 25, 2019 11:06
-
-
Save piotros/0a00b58f5b216f6fa0bd200d987bdaeb to your computer and use it in GitHub Desktop.
Rename files tool
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
#!/usr/bin/env node | |
const FileHound = require('filehound'); | |
const fs = require('fs'); | |
const files = FileHound.create() | |
.paths('./application') | |
.ext('ftlh') | |
.find(); | |
files.then(files => { | |
files.forEach(file => { | |
fs.rename(file, file + '.html', function(err) { | |
if ( err ) console.log('ERROR: ' + err); | |
}); | |
}); | |
}); |
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
{ | |
"name": "rename-files", | |
"version": "0.0.0", | |
"bin": "./index.js", | |
"dependencies": { | |
"filehound": "latest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment