1.0.2 • Published 23 days ago

clipboard-copy-paste-helper v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

clipboard-copy-paste-helper

A utility library for simplifying clipboard operations (copy and paste) in web applications.

Installation

To install clipboard-copy-paste-helper, run:

npm install clipboard-copy-paste-helper

Usage

The library provides two main functions: copyTextToClipboard for copying text to the clipboard, and pasteTextFromClipboard for pasting text from the clipboard.

Copying Text to Clipboard

const { copyTextToClipboard } = require('clipboard-copy-paste-helper');

copyTextToClipboard('Hello, world!').then(() => {
console.log('Text copied successfully!');
});

Pasting Text from Clipboard

const { pasteTextFromClipboard } = require('clipboard-copy-paste-helper');

pasteTextFromClipboard().then(text => {
console.log('Pasted text:', text);
});

Note: Clipboard operations require user interaction in most browsers (e.g., inside a click event handler) and may also require specific permissions or secure contexts (https).

License

This project is licensed under the MIT License.

1.0.2

23 days ago

1.0.1

2 months ago

1.0.0

2 months ago