Socket
Socket
Sign inDemoInstall

state-copy

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    state-copy

takes an object as input then serializes it as JSON and copies it to your clipboard


Version published
Maintainers
1
Install size
45.5 kB
Created

Readme

Source

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

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

License

MIT

Keywords

FAQs

Last updated on 27 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc