node package to convert a javascript source string into a bookmarklet
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
test
.gitignore
README.md
bookmarkletify.js
package.json

README.md

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