clipd

    1.0.0 • Public • Published

    Table of Contents

    Puny 721 byte copy to clipboard library



    Built with ❤︎ by Tiaan and contributors

    Table of Contents

    Table of Contents
  • About
  • Install
  • Usage
  • API
  • example
  • Contribute
  • License
  • About

    A puny 721 byte(gzipped & minified) copy to clipboard library. For modern browsers.

    Install

    With cdn:

    <script src="https://unpkg.com/clipd/lib/clipd.min.js"></script>
    <!-- Or -->
    <script src="https://rawgit.com/tiaanduplessis/clipd/master/lib/clipd.min.js"></script>

    With Bower:

    $ bower install clipd

    With npm:

    $ npm install --save clipd

    With yarn:

    $ yarn add clipd

    Usage

     
    // Works with a string selector or element node
     
    clipd('.selector')
     
    // OR
     
    const elem = document.getElementById('elem')
    clipd(elem)
     

    API

    The module exports a single function with signature:

    clipd(selector|elementNode, options)

    Current available options:

    {
        event: 'click', // Event to trigger copy on. Default 'click
        callback: (result) => {} // callback with the result of copy(boolean)
    }

    Example

    Check out the example directory.

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    Install

    npm i clipd

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • tiaanduplessis