Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bookmarkletify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bookmarkletify - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

bin/bookmarkletify

29

package.json
{
"name": "bookmarkletify",
"version": "0.0.1",
"version": "1.0.0",
"description": "From a single javascript file, create a bookmarklet",
"main": "bookmarkletify.js",
"bin": {
"bookmarkletify": "bin/bookmarkletify"
},
"scripts": {
"test": "vows test/test.js"
"test": "vows test/test*"
},
"repository": "",
"repository": {
"type": "git",
"url": "https://github.com/johnkpaul/bookmarkletify.git"
},
"author": "John K. Paul <john@johnkpaul.com> (http://twitter.com/johnkpaul)",
"contributors": [
"Oli Evans <oli@tableflip.io> (http://twitter.com/olizilla)"
],
"license": "MIT",

@@ -15,10 +24,12 @@ "keywords": [

],
"repository": {
"type": "git",
"url": "https://github.com/johnkpaul/bookmarkletify.git"
"dependencies": {
"concat-stream": "^1.4.7",
"nomnom": "^1.8.1",
"string-to-stream": "^1.0.0",
"uglify-js": "~1.3.4",
"vows": "~0.6.4"
},
"dependencies": {
"vows": "~0.6.4",
"uglify-js": "~1.3.4"
"devDependencies": {
"vows": "^0.8.1"
}
}

@@ -5,6 +5,12 @@ # bookmarkletify

## Usage
# example
As a **module**
``` js
```sh
npm install bookmarkletify
```
```js
var bookmarkletify = require('bookmarkletify');

@@ -17,12 +23,12 @@ var source = 'alert( window.location )';

# install
or as a **command line tool**
With [npm](https://npmjs.org) do:
```sh
npm install -g bookmarkletify
bookmarkletify input.js -o output.bookmarklet
```
npm install bookmarkletify
```
# license
## license
MIT

@@ -6,16 +6,19 @@ var bookmarkletify = require('../bookmarkletify');

vows.describe('bookmarkletify creates bookmarklet').addBatch({
'Bookmarkletify': {
topic: bookmarkletify,
'creates bookmarklet, when passed source': function(){
var source = 'alert( window.location )';
var bookmarkletString = bookmarkletify(source);
assert.equal(bookmarkletString, 'javascript:(function(){;alert(window.location);})()');
},
'will encode uris, if there': function(){
var source = 'alert("http://google.com/test test");';
var bookmarkletString = bookmarkletify(source);
assert.equal(bookmarkletString, 'javascript:(function(){;alert(%22http://google.com/test%20test%22);})()');
vows.describe('bookmarkletify').addBatch({
'when passed a javascript string': {
topic: function () {
return bookmarkletify('alert( window.location )');
},
'returns a bookmarklet': function (topic) {
assert.equal(topic, 'javascript:(function(){;alert(window.location);})()');
}
},
'when passed a javascript string with non-url-safe characters': {
topic: function () {
return bookmarkletify('alert("http://google.com/test test");');
},
'returns a url-safe bookmarklet': function (topic) {
assert.equal(topic, 'javascript:(function(){;alert(%22http://google.com/test%20test%22);})()');
}
}
}).export(module);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc