{"id":13518262,"url":"https://github.com/callmecavs/gotem","last_synced_at":"2025-04-06T10:10:59.054Z","repository":{"id":57252589,"uuid":"80258121","full_name":"callmecavs/gotem","owner":"callmecavs","description":"Copy to clipboard for modern browsers in less than 1kb.","archived":false,"fork":false,"pushed_at":"2017-03-31T20:02:31.000Z","size":9,"stargazers_count":428,"open_issues_count":2,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T09:09:10.119Z","etag":null,"topics":["clipboard","copy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/callmecavs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-28T00:44:20.000Z","updated_at":"2024-09-20T21:12:00.000Z","dependencies_parsed_at":"2022-08-31T22:20:41.571Z","dependency_job_id":null,"html_url":"https://github.com/callmecavs/gotem","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmecavs%2Fgotem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmecavs%2Fgotem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmecavs%2Fgotem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmecavs%2Fgotem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callmecavs","download_url":"https://codeload.github.com/callmecavs/gotem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464220,"owners_count":20942970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clipboard","copy"],"created_at":"2024-08-01T05:01:42.856Z","updated_at":"2025-04-06T10:10:59.032Z","avatar_url":"https://github.com/callmecavs.png","language":"JavaScript","funding_links":[],"categories":["UI","JavaScript","UI Components / UI Tools"],"sub_categories":[],"readme":"# gotem\n\n[![gotem on NPM](https://img.shields.io/npm/v/gotem.svg?style=flat-square)](https://www.npmjs.com/package/gotem) [![Standard JavaScript Style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/)\n\nCopy to clipboard for modern browsers in less than 1kb.\n\n## Install\n\n```sh\n$ npm i gotem --save\n```\n\n## Use\n\n`gotem` is a function that accepts 3 parameters:\n\n1. A **required** trigger node.\n2. A **required** target node.\n3. An **optional** object of callback functions.\n\nExamples follow:\n\n```javascript\nimport gotem from 'gotem'\n\n// a trigger and target node are required\nconst nodes = {\n  trigger: document.getElementById('trigger'),\n  target: document.getElementById('target')\n}\n\n// when the trigger is clicked,\n// the text of the target will be copied to the clipboard\ngotem(nodes.trigger, nodes.target)\n\n// if an object with callback functions (success, error) is passed,\n// the appropriate function, based on the result of executing the copy command, will be fired if it exists\ngotem(nodes.trigger, nodes.target, {\n  success: () =\u003e console.log('Copy command succeeded'),\n  error: () =\u003e console.log('Copy command failed, BUT the text to copy has still been selected.')\n})\n```\n\n## Browser Support\n\ngotem requires [`execCommand`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand) cut/copy support.\n\nAs such, it works in the following:\n\n* Chrome 43+\n* Firefox 41+\n* Safari 10+\n* Edge 12+\n* IE 9+\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT). © 2017 Michael Cavalea\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmecavs%2Fgotem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallmecavs%2Fgotem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmecavs%2Fgotem/lists"}