unstale

npm / copy-to-clipboard

copy-to-clipboard

What changed in copy-to-clipboard 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

4 breaking4 new APIs and options2 behavior and defaults1 tooling3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

copy-to-clipboard 412 changes

Breaking changes 4

  • copy() is now async and returns Promise<boolean>; call sites must use await or .then(...).

    4.0.0release notes

  • The window.prompt() fallback is off by default; pass options.fallbackToPrompt: true to enable it.

    4.0.0release notes

  • IE11 support and its window.clipboardData and IE-specific code paths have been removed.

    4.0.0release notes

  • Build output moved to dist/, so direct require('copy-to-clipboard/index.js') imports break; use the package name instead.

    4.0.0release notes

New APIs and options 4

  • The package now provides dual ESM/CJS output with a proper exports field and sideEffects: false.

    4.0.0release notes

  • TypeScript declarations are provided for ESM consumers, alongside index.d.ts for CJS consumers.

    4.0.0release notes

  • Set a custom MIME type to copy formatted content; text/plain is always included alongside it.

    4.0.0release notes

  • The callback receives a ClipboardItem on the async path or a DataTransfer on the execCommand fallback path; it can return a replacement to override.

    4.0.0release notes

Behavior and default changes 2

  • Rich text and HTML copying uses navigator.clipboard.write() with ClipboardItem when options.format or options.onCopy is set.

    4.0.0release notes

  • In secure contexts, navigator.clipboard.writeText() is now the default copy path.

    4.0.0release notes

Fixes and other changes 2

  • Fixed execCommand so it works in fullscreen.

    4.0.2release notes

  • Fixes copying in a modal when the execCommand fallback is used.

    4.0.1release notes

copy-to-clipboard 32 changes

Tooling 1

  • The guide now recommends Python's built-in venv for creating virtual environments instead of virtualenvwrapper.

    3.3.0docs

Fixes and other changes 1

  • Ubuntu users must install python3-venv before using venv.

    3.3.0docs