Files
sashinexists/node_modules/smartypants/bin/smartypantsu.js
2024-12-07 13:18:31 +11:00

25 lines
416 B
JavaScript
Executable File

#! /usr/bin/env node
if (process.stdin.isTTY) {
console.error('No input!');
process.exit(1);
}
var smartypants = require('..').smartypantsu;
var text = '';
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
var chunk = process.stdin.read();
if (chunk !== null) {
text = text + chunk;
}
});
process.stdin.on('end', () => {
process.stdout.write(smartypants(text, '1'));
});