Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jekrb/state-copy
takes an object as input then serializes it as JSON and copies it to your clipboard from the browser
https://github.com/jekrb/state-copy
Last synced: 3 months ago
JSON representation
takes an object as input then serializes it as JSON and copies it to your clipboard from the browser
- Host: GitHub
- URL: https://github.com/jekrb/state-copy
- Owner: jakeburden
- Created: 2017-07-05T15:41:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T03:53:09.000Z (almost 2 years ago)
- Last Synced: 2024-04-16T00:31:02.469Z (7 months ago)
- Language: JavaScript
- Size: 661 KB
- Stars: 14
- Watchers: 2
- Forks: 3
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# state-copy
> takes an object as input then serializes it as JSON and copies it to your clipboard
Makes it easier to copy application state to your clipboard from the browser.
## Usage
```js
var stateCopy = require('state-copy')window.addEventListener('keyup', function (e) {
// press 'c' to copy current state to clipboard
if (e.keyCode === 67) {
stateCopy({wow: 'cool'})
}
})
```what gets copied to clipboard
```
{"wow":"cool"}
```## Notes
Must be called in response to a user gesture event, like click or keyup.
## Install
```
$ npm install state-copy
```## Acknowledgments
state-copy was inspired by [@yoshuawuyts tweet](https://twitter.com/yoshuawuyts/status/882606862981615616)
## License
MIT