surrog8
Version:
Surrogate pair converter with dev-friendly source code.
15 lines (12 loc) • 407 B
JavaScript
/* -*- coding: UTF-8, tab-width: 2 -*- */
/*jslint indent: 2, maxlen: 80, node: true */
;
var sg = require('./sg8'), argv = process.argv.slice(2);
if (argv.length) {
argv.forEach(function (arg) { console.log(sg.uHHHH(arg)); });
} else {
process.stdin.on('data', function (chunk) {
process.stdout.write(String(chunk).split(/\n/).map(sg.uHHHH).join('\n'));
});
}