Clipboard Helper

v1.0.0

Global utility function to copy text in the clipboard.

Copy to clipboard

copyToClipboard() uses the browser Clipboard API and resolves after the text has been written.

import { copyToClipboard } from '@oardi/ts-utils';

await copyToClipboard('some text');

The Clipboard API requires a browser environment and may require HTTPS or explicit user permission.

Previous:Helpers

← Canvas Helper

Next:Helpers

CSV Helper →