Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard Management in NodeJS #52541

Closed
RedYetiDev opened this issue Apr 15, 2024 · 4 comments
Closed

Clipboard Management in NodeJS #52541

RedYetiDev opened this issue Apr 15, 2024 · 4 comments
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@RedYetiDev
Copy link
Member

RedYetiDev commented Apr 15, 2024

What is the problem this feature will solve?

The absence of a clipboard feature in NodeJS poses a challenge for users who need to copy and paste text or data from NodeJS applications. Without this feature, users must resort to manual methods, such as selecting and copying text using keyboard shortcuts, which can be cumbersome and time-consuming.

What is the feature you are proposing to solve the problem?

The proposed feature idea would be implementing clipboard functionality in NodeJS, similar to the navigator.clipboard feature available in web browsers. This feature would allow users to easily copy text or data from NodeJS applications and paste it into other applications or documents.

We've seen that it is not impossible to add this feature, as many libraries (like https://github.com/dacap/clip) have done it before in CPP. I'm happy to help with the JS side of things, but CPP isn't my forte.

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

@RedYetiDev RedYetiDev added the feature request Issues that request new features to be added to Node.js. label Apr 15, 2024
@RedYetiDev
Copy link
Member Author

BTW I'm currently working on an implementation for this, but it make take a while to complete, as it must fit the ClipboardAPI spec, while also being cross-platform.

@targos
Copy link
Member

targos commented Apr 18, 2024

Cross-platform I/O is generally implemented by libuv. I don't know if it would make sense to have clipboard-related stuff there.

@meyfa
Copy link
Contributor

meyfa commented Apr 18, 2024

AFAIK, on Linux, the clipboard is not even part of the kernel, but lives in userspace (managed by X11, for example). This means there would be environments in which Node.js can run that don't have any concept of a clipboard, so it wouldn't be guaranteed to work.

Also, I think relatively few Node.js use-cases include working with the clipboard. This seems perfect for an npm package. Why can it not be a package?

@RedYetiDev
Copy link
Member Author

Your probably right, thanks for the advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
Status: Pending Triage
Development

No branches or pull requests

3 participants