copied
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Copied

Copy to clipboard in browser.

npm install copied
import copied from 'copied'
const btn = document.getElementById('btn')

btn.addEventListener('click', () => {
    btn.setAttribute('disabled', "true")
    copied('Hello Text !', (err) => {
        if (err) {
            console.error(err)
        } else {
            console.log('Copied !')
            btn.innerText = 'Copied !'
            setTimeout(() => {
                btn.innerText = 'Copy'
                btn.removeAttribute('disabled')
            }, 500)
        }
    })
})

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i copied

    Weekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    2.52 kB

    Total Files

    5

    Last publish

    Collaborators

    • lanyue