copy-text-to-clipboard

WebJar for copy-text-to-clipboard

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий CLI Взаимодействие с пользователем
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-sindresorhus-copy-text-to-clipboard
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

copy-text-to-clipboard
WebJar for copy-text-to-clipboard
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/copy-text-to-clipboard

Скачать github-com-sindresorhus-copy-text-to-clipboard

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-sindresorhus-copy-text-to-clipboard</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/
implementation 'org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard/
implementation ("org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:1.0.4")
'org.webjars.npm:github-com-sindresorhus-copy-text-to-clipboard:jar:1.0.4'
<dependency org="org.webjars.npm" name="github-com-sindresorhus-copy-text-to-clipboard" rev="1.0.4">
  <artifact name="github-com-sindresorhus-copy-text-to-clipboard" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-sindresorhus-copy-text-to-clipboard', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "github-com-sindresorhus-copy-text-to-clipboard" % "1.0.4"
[org.webjars.npm/github-com-sindresorhus-copy-text-to-clipboard "1.0.4"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

copy-text-to-clipboard

Copy text to the clipboard in modern browsers (0.2 kB)

Try it out!

Comparison

Install

$ npm install copy-text-to-clipboard

Usage

const copy = require('copy-text-to-clipboard');

button.addEventListener('click', () => {
	copy('🦄🌈');
});

API

copy(text, options?)

Copy text to the clipboard.

Returns a boolean of whether it succeeded to copy the text.

Must be called in response to a user gesture event, like click or keyup.

options

Type: object

target

Type: HTMLElement
Default: document.body

Specify a DOM element where the temporary, behind-the-scenes textarea should be appended, in cases where you need to stay within a focus trap, like in a modal.

Related

  • clipboardy - Access the system clipboard (copy/paste) in Node.js

Версии библиотеки

Версия
1.0.4