bookmarkletify
Advanced tools
Comparing version 0.0.1 to 1.0.0
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4427
9
79
1
33
5
1
2
+ Addedconcat-stream@^1.4.7
+ Addednomnom@^1.8.1
+ Addedstring-to-stream@^1.0.0
+ Addedansi-styles@1.0.0(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedchalk@0.4.0(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedhas-color@0.1.7(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addednomnom@1.8.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring-to-stream@1.1.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@0.1.1(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedunderscore@1.6.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)