Copy to clipboard
See original GitHub issueI use most of my Carbon images on Twitter to illustrate some code snippet. Would be useful if this tool could just put the image in the clipboard instead of writing to disk. For example, if I use the a --copy
flag.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:7 (4 by maintainers)
Top Results From Across the Web
copy-to-clipboard - npm
Simple module exposing copy function that will try to use execCommand with fallback to IE-specific clipboardData interface and finally, resort ...
Read more >How To Copy to Clipboard - W3Schools
Learn how to copy text to the clipboard with JavaScript. Click on the button to copy the text from the text field. Copy...
Read more >Copy and paste using the Office Clipboard - Microsoft Support
Open the file that you want to copy items from. · Select the first item that you want to copy, and press CTRL+C....
Read more >Copy to Clipboard - Apps on Google Play
Simple function, help copy photo from your gallery to clipboard. you can utilize Google Keyboard to paste to other apps that support pasting...
Read more >clipboard.js — Copy to clipboard without Flash
Copy text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just published
v1.3.0
where this is available. 🙂🎉npm i -g carbon-now-cli
to update to that version.✅ Cross-OS 😱 ✅ Docs are here
Example of using it with a preset + pasting to Twitter:
Thank you all for chiming in! ❤️
@sindresorhus Maybe you could chime in on this since I am using your lovely
execa
to run the OS-specific scripts. 🙂 As mentioned in my comment above, it works flawlessly on macOS — it copies to clipboard and exits properly.On Linux, it copies properly, but doesn’t exit — it’s like the Promise is
pending
forever. You can see it doesn’t exit theCopying image to clipboard
stage inside theListr
task.The relevant code for this can be found in this section of
cli.js
. Am I missing something here?I’ve also noticed that it exits and copies properly on Linux when I use
execa
withoutawait
. It doesn’t copy to clipboard on macOS then though.