# @vavt/copy2clipboard

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

Latest version **1.0.3** (published 2025-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vavt/copy2clipboard
pnpm add @vavt/copy2clipboard
yarn add @vavt/copy2clipboard
bun add @vavt/copy2clipboard
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2025-05-16 |
| First published | 2025-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | imzbf |
| Keywords | javascript, typescript |

## Links

- npm: https://www.npmjs.com/package/@vavt/copy2clipboard
- Repository: https://github.com/imzbf/copy2clipboard
- Homepage: https://github.com/imzbf/copy2clipboard#readme
- Issues: https://github.com/imzbf/copy2clipboard/issues
- npm.io page: https://npm.io/package/@vavt/copy2clipboard

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2025-05-16
- 1.0.1 — 2025-03-11
- 1.0.0 — 2025-03-05

## README

# @vavt/copy2clipboard

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

## Install

```shell
yarn add @vavt/copy2clipboard
```

Or

```shell
npm i @vavt/copy2clipboard
```

## Usage

```js
import copy2clipboard from '@vavt/copy2clipboard';

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

---
_Source: https://npm.io/package/@vavt/copy2clipboard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
