clipboard-copy-paste-helper
Advanced tools
Comparing version 1.0.0 to 1.0.1
23
index.js
@@ -1,1 +0,22 @@ | ||
console.log('Init library') | ||
// Function to copy text to the clipboard | ||
async function copyTextToClipboard(text) { | ||
try { | ||
await navigator.clipboard.writeText(text); | ||
console.log('Text copied to clipboard'); | ||
} catch (err) { | ||
console.error('Failed to copy: ', err); | ||
} | ||
} | ||
// Function to paste text from the clipboard | ||
async function pasteTextFromClipboard() { | ||
try { | ||
const text = await navigator.clipboard.readText(); | ||
console.log('Text pasted from clipboard: ', text); | ||
return text; | ||
} catch (err) { | ||
console.error('Failed to paste: ', err); | ||
} | ||
} | ||
module.exports = { copyTextToClipboard, pasteTextFromClipboard }; |
{ | ||
"name": "clipboard-copy-paste-helper", | ||
"version": "1.0.0", | ||
"description": "", | ||
"version": "1.0.1", | ||
"description": "Simplify clipboard operations (copy and paste) in web applications.", | ||
"main": "index.js", | ||
@@ -9,2 +9,12 @@ "scripts": { | ||
}, | ||
"keywords": [ | ||
"clipboard", | ||
"copy", | ||
"paste", | ||
"text" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eternaldarron/clipboard-copy-paste-helper" | ||
}, | ||
"author": "", | ||
@@ -11,0 +21,0 @@ "license": "MIT", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2321
4
20
1
42
0
0