Created
January 16, 2016 22:37
-
-
Save vsemozhetbyt/2a470efb0a284c5ed891 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
const path = process.argv[2]; | |
if (!path) { | |
console.log('Add the file path, please.'); | |
process.exit(); | |
} | |
const fs = require('fs'); | |
fs.createReadStream(path, {encoding: 'utf8'}) | |
.pipe(fs.createWriteStream(path.replace(/(\.[^.]+)?$/, '.utf16$1'), {encoding: 'utf16le'})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment