Created
February 8, 2018 16:25
-
-
Save beaulac/7c07f0d45d162df78ddc2b62c5df8a2c to your computer and use it in GitHub Desktop.
Copy to clipboard w/ Node on Mac
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
const cp = require('child_process'); | |
const clip = cp.exec('pbcopy', (_err, _stdout, _stderr) => {/* optionally do something */}); | |
clip.stdin.write(aString); | |
clip.stdin.end(() => process.stdout.write(`\rCopied ${aString.length} characters.\n`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment