Skip to content

Instantly share code, notes, and snippets.

@novemberborn
Created April 2, 2011 16:46
Show Gist options
  • Save novemberborn/899634 to your computer and use it in GitHub Desktop.
Save novemberborn/899634 to your computer and use it in GitHub Desktop.
Convert pasteboard string into JSON
#!/usr/bin/env node
require("child_process").exec("pbpaste", function(_, stdout){
process.stdout.write(JSON.stringify(stdout.trim()));
});
@novemberborn
Copy link
Author

Save as pbjson, do chmod +x pbjson, then use ./pbjson|pbcopy.

I suppose the pasteboard commands only work on OS X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment