Created
April 2, 2011 16:46
-
-
Save novemberborn/899634 to your computer and use it in GitHub Desktop.
Convert pasteboard string into JSON
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
#!/usr/bin/env node | |
require("child_process").exec("pbpaste", function(_, stdout){ | |
process.stdout.write(JSON.stringify(stdout.trim())); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save as
pbjson
, dochmod +x pbjson
, then use./pbjson|pbcopy
.I suppose the pasteboard commands only work on OS X.