Giter VIP home page Giter VIP logo

bookmarklet's Introduction

Bookmarklet: sane development, familiar format

Bookmarklet is a nodejs module for compiling bookmarklets in server-side code and directly from the shell. You can run it on any JavaScript file—it will minify it using uglify-js, wrap it in a self executing function, and return an escaped bookmarklet.

More so, it supports a metadata block—modeled after the greasemonkey userscript metadata block—to specify metadata, external stylesheets and script includes, which can look like this:

// ==Bookmarklet==
// @name LoveGames
// @author Old Gregg
// @style http://www.cornify.com/css/cornify.css
// @script https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/Bookmarklet==

Most notably, you can specify any external scripts that you’d like your bookmarklet to include via the @script rule, which can be repeated as many times as you’d like.

NOTE: currently with script includes you have to handle noConflict scenarios yourself, e.g., you might want to start off a script with var $ = jQuery.noConflict(true).

In addition, any css files included with @style will be injected.

This project is open to suggestions & pull requests.

Also, if you’re just looking for a quick way to throw together a bookmarklet, try my browser-based bookmarklet creator.

Installation

The dependency can be found on NPM as “bookmarklet”. You can install it with:

npm install -g bookmarklet

Usage

You can easily see usage by running bookmarklet -h:

> bookmarklet -h
Bookmarklet v0.0.1 usage: bookmarklet source [destination]

source      - path to file to read from or `-` for stdin
destination - path to file to write to

bookmarklet's People

Contributors

mrcoles avatar ronnyo avatar didericis avatar nathanathan avatar vzvu3k6k avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.