-
-
Save voodooattack/45711ace6ffc8a57ec93b346601b33a2 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
var startTime = Date.now() | |
var fs = require('fs') | |
var Iconv = require('iconv').Iconv | |
var cluster = require('cluster') | |
var workers; | |
if (cluster.isMaster) workers = [1, 2, 3, 4].map(_ => cluster.fork()) | |
if (!cluster.isMaster) | |
{ | |
var converter = new Iconv('UTF-8', 'UTF-16LE') | |
var input = fs.createReadStream('./enwik8') | |
var out = fs.createWriteStream('enwik16_' + Date.now()) | |
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