Last active
February 21, 2017 00:22
-
-
Save tjwebb/6fc20623c23193f976040660c34b5ced to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const dir = '.' // set dir | |
const co = require('co') | |
const fs = require('mz/fs') | |
co(function *() { | |
const files = yield fs.readdir(dir) | |
for (const f of files) { | |
if (/\.csv$/.test(f)) { | |
yield fs.rename(f, f.replace(/\.csv$/, '.txt')) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment