Skip to content

jakeburden/state-copy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •