Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env node
const pinyin = require("pinyin");
const clipboardy = require('clipboardy');
const dialog = require('dialog-node');
function toPinyin(mandarin) {
return mandarin + " \n" + pinyin(mandarin).join(" ");
}
const callback = function(code, retVal, stderr) {
clipboardy.writeSync(toPinyin(retVal));
}
dialog.entry('Type some text', "entry prompt", 0, callback);
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.