Support for clipboardy
from my experience copy-paste has several issues - which clipboardy does not. Would it be possible to add in support? https://github.com/sindresorhus/clipboardy
Have you tried using clipboardy within an app packaged with pkg and it failed? It seems to work fine for me.
@gabemarshall that's great to hear. I have come into problems with the app packaged from pkg not being able to find the copy or paste executables on windows - i have not attempted on other OS's.
I can confirm that both modules fail when called from inside a binary built with pkg on Windows. Here is clipboardy:
Error: spawn C:\\snapshot\\vagrant\\node_modules\\clipboardy\\fallbacks\\windows\\paste.exe
And node-copy-paste:
Error: Command failed: cscript /Nologo C:\snapshot\Users\IEUser\myapp\node_modules\copy-paste\platform\fallbacks\paste.vbs
yeah the issue is clipboardy provides its own exes for utilizing the clipboard. Not much pkg can do to fix that - although it seemed like they had added a patch to support for node-copy-paste in the past.
Ahh yes sorry about that, wasn't thinking of Windows support when I first read the issue. I'll look into it this weekend (I have a project that needs copy/paste support as well).
Any updates regarding this? I have a project that requires copy/paste support and pkg and clipboardy still do not work together.
I am also looking for support for clipboardy within pkg or a workaround to use it as an uncompiled external module. Any updates?
Update: I found a quick half solution to include the uncompiled clipboardy module by doing the following: const path = require('path'); const clipboard = require(path.join(process.cwd(), '/node_modules/clipboardy'));
and then just have the node_modules folder available inside the directory with the pkged script.
I'd still like to find a solution that pkgs everything into a single executable.
Apologies for committing over a year ago to look into this and letting it fall by the wayside. I'm taking another look now based on the idea I had and will hopefully come back with some good news shortly.
For now I ended up writing a simple patch script that iterates over the "lib" directory files and searches their text for all the occurrences of the fallback executables paths and rewrites the matched paths with paths to the current working directory. Then it copies the executables to the working dir.
Thank you for looking further into it @gabemarshall
@LinkTree3 @JoeNimble I have a modified fork of node-copy-paste that seems to work fine, but it could use some additional testing if you have a chance. I'm sure something similar could be implemented into clipboardy if necesary.
https://github.com/gabemarshall/node-copy-paste https://github.com/gabemarshall/node-copy-paste/blob/master/platform/win32.js
@gabemarshall I haven't tested it yet but I did go over your code and it looks wonderful. That ps script to create a new htmlfile object and get the clipboard data from it is really cool.
I personally wanted to use Clipboardy because it seems to be cleaner and more well supported