Last active
April 28, 2016 18:14
-
-
Save irony/d44cbda0c71707e89274edd63fcc3d35 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 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