Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var fs = require('fs')
var Iconv = require('iconv').Iconv
var cluster = require('cluster')
if (cluster.isMaster) [1, 2, 3, 4].forEach(_ => cluster.fork())
var converter = new Iconv('UTF-8', 'UTF-16LE')
var input = fs.createReadStream('./enwik8')
var out = fs.createWriteStream('outfile' + new Date())
input.pipe(converter).pipe(out)
out.on('close', _ => process.exit())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.