New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

text-copy

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-copy

a small js library for copying text to clipboard

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
62
-31.11%
Maintainers
1
Weekly downloads
 
Created
Source

text-copy

downloads version issues package size forks stars license programming language

a small js library ( preview badge ) for copying text to clipboard.

Tested on: Chrome, Firefox, Safari, Edge and IE11.

Browser usage

Load index.js. You can use a CDN like below.

<script src="//cdn.jsdelivr.net/npm/text-copy/index.min.js" ></script>

Then CopyText function is availabe. Use it like below.

<button onClick="CopyText('text to copy')">copy</button>

CopyText() returns true if text is successfully copied.

NPM usage

If you want to use it in JS frameworks like Vue or React, install it as below.

npm i text-copy

and then use it as below

import copy from 'text-copy'

// some where it the code
let isCopied = copy('text to copy')

Note: copy function should be called inside a user-generated event listener.

Keywords

clipboard

FAQs

Package last updated on 03 Jun 2021

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