Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bookmarkletify

johnkpaul115MIT1.0.0

From a single javascript file, create a bookmarklet

bookmarklet

readme

bookmarkletify

convert javascript source into the format needed for a bookmarklet

Usage

As a module

npm install bookmarkletify
var bookmarkletify = require('bookmarkletify');
var source = 'alert( window.location    )';
var bookmarkletString = bookmarkletify(source);

console.log(bookmarkletString); //javascript:(function(){;alert(window.location);})()

or as a command line tool

npm install -g bookmarkletify
bookmarkletify input.js -o output.bookmarklet

license

MIT