Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clipbrd

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipbrd

Lightweight copy to clipboard for modern browsers

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
241
decreased by-27.84%
Maintainers
1
Weekly downloads
 
Created
Source

clipbrd

NPM Package License: MIT

Lightweight module to copy text to the clipboard in modern browsers

Install

npm install clipbrd

Usage

import * as clipboard from 'clipbrd';

if (clipboard.isSupported()) {
    button.addEventListener('click', () => {
        clipboard.copy('Custom text');
    });
}

API

copy(text)

Copy text to the clipboard.

Returns a boolean of whether it succeeded.

Must be called in response to a user gesture event, like click or keyup.

isSupported()

Check if copy is supported, that way you can hide copy buttons from the UI.

Returns a boolean

Reference

License

MIT License

Keywords

FAQs

Package last updated on 26 Jul 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc