JSPM

@vavt/copy2clipboard

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3677
  • Score
    100M100P100Q138727F
  • License MIT

Use `navigator.clipboard` to copy content, use `execCommand` when it doesn't work compatibility.

Package Exports

  • @vavt/copy2clipboard
  • @vavt/copy2clipboard/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vavt/copy2clipboard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@vavt/copy2clipboard

Use navigator.clipboard to copy content, use execCommand when it doesn't work compatibility.

Install

yarn add @vavt/copy2clipboard

Or

npm i @vavt/copy2clipboard

Usage

import copy2clipboard from '@vavt/copy2clipboard';

copy2clipboard('Hello!')
  .then(() => {
    console.log('✅ Successed!');
  })
  .catch(() => {
    console.log('❌ Failed!');
  });