Encoding and decoding for bookmarklets.
Home | MIT License | v1.0.0
Bookmarklets don't need to be a mess. The key is insulating yourself from what the browser stores with an encode/decode step. That's what bmlet provides. bmlet encode
transforms a normal JS file into a bookmarklet, bmlet decode
recovers the original file. Your code doesn't need to deal with bookmarklet quirks like URI-encoding or the implicit document.write
, and also gets its own namespace, strict mode, and automatic uncaught error display.
npm install --global bmlet
Encodes stdin, outputs to stdout.
Decodes stdin, outputs to stdout. Only works on bookmarklets created using this library.
Encodes code
, returns the result.
Decodes bookmarklet
, returns the result. Only works on bookmarklets created using this library.