Skip to content

rafaelrinaldi/bookmarkletify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bookmarkletify Build Status

Convert JavaScript files to bookmarklets

Install

Download it to /usr/local/bin via cURL:

$ curl https://raw.githubusercontent.com/rafaelrinaldi/bookmarkletify/master/bookmarkletify > /usr/local/bin/bookmarkletify

Compile the binary:

$ chmod +x /usr/local/bin/bookmarkletify

Requirements

Node.js (>=8)

Usage

Usage: bookmarkletify <FILE>

  Convert JavaScript files to bookmarklets

Example:
  $ bookmarkletify script.js

Via stdin:
  $ cat script.js | bookmarkletify

Options:
  -h --help                Display software usage

Creating a bookmarklet

To generate a simple bookmarklet for Google Chrome that displays 42 on screen:

$ # Generate the output and pipe it the system clipboard
$ echo "alert(42);" | bookmarkletify | pbcopy

Cmd Shift b to show the bookmarks bar, then right click on it and select "Add Page":

add-page

Give your bookmarklet a name and, on the URL field, paste the code we previously generated from the command line:

create-bookmarklet

Now if you click on the bookmarklet you should see the expected result:

expected-result

License

MIT © Rafael Rinaldi


Buy me a ☕

About

🔖 Convert JavaScript files to bookmarklets

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages