Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Copy text from browser to clipboard...natively! Less than 1 kB!
Have you ever wanted to send a string to the user's clipboard? Front-end developers have invented many hacks to get around this limitation...until now!
Introducing copee
, a micro-wrapper around the browser's native "copy text" API 🗜️
Death to Adobe Flash 💀
Try the demo to see copee
in action!
You can view the page source to quickly learn how to use it.
Also, read this blog post for some background.
<script type="module">
import { toClipboard } from 'https://cdn.jsdelivr.net/npm/copee/dist/copee.mjs';
document.getElementById('btn').addEventListener('click', () => {
const success = toClipboard('Wow, "copee" works via ES Modules!');
if (success) {
// it worked, check your clipboard!
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/copee/dist/copee.umd.js"></script>
<script type="text/javascript">
document.getElementById('btn').addEventListener('click', function () {
var success = copee.toClipboard('Wow, "copee" works!');
if (success) {
// it worked, check your clipboard!
}
});
</script>
.js
) supports IE 11+, Chrome 43+, Opera 29+, and Firefox 41+This package was influenced by the following:
Developed by ceriously.com
FAQs
Copy text from browser to clipboard...natively! < 1kB
The npm package copee receives a total of 92 weekly downloads. As such, copee popularity was classified as not popular.
We found that copee demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.