Comparing version 0.2.5 to 0.3.0
module.exports = require('./lib/app'); | ||
module.exports = require('./lib/crushit'); |
{ | ||
"name": "crushit", | ||
"version": "0.2.5", | ||
"description": "Script minifier for production", | ||
"main": "lib/app.js", | ||
"version": "0.3.0", | ||
"description": "CrushIt is a commandline tool for crawling web pages and compiling scripts", | ||
"homepage": "http://qawemlilo.github.io/crushit/", | ||
"main": "bin/crushit", | ||
"directories": { | ||
"test": "test" | ||
"test": "test", | ||
"lib": "lib", | ||
"bin": "bin" | ||
}, | ||
"scripts": { | ||
"test": "mocha test/main.js test/app.js" | ||
"test": "npm run jshint && node node_modules/mocha/bin/mocha test", | ||
"jshint": "node node_modules/jshint/bin/jshint lib/helper.js lib/crushit.js" | ||
}, | ||
@@ -17,3 +21,6 @@ "repository": { | ||
"keywords": [ | ||
"script minifier", "compressor", "optimizer" | ||
"script minifier", | ||
"compressor", | ||
"optimizer", | ||
"build tool" | ||
], | ||
@@ -23,14 +30,17 @@ "author": "Qawelesizwe Mlilo", | ||
"dependencies": { | ||
"request": "~2.12.0", | ||
"cheerio": "~0.10.3", | ||
"uglify-js": "~2.2.3", | ||
"commander": "~1.1.1" | ||
"request": "~2.34.0", | ||
"cheerio": "~0.13.1", | ||
"uglify-js": "~2.4.12", | ||
"commander": "~2.1.0" | ||
}, | ||
"preferGlobal": true, | ||
"devDependencies": { | ||
"mocha": "~1.7.4", | ||
"should": "~1.2.1" | ||
"mocha": "latest", | ||
"should": "latest", | ||
"jshint": "latest" | ||
}, | ||
"bin": { "crushit": "bin/crushit" }, | ||
"bin": { | ||
"crushit": "bin/crushit" | ||
}, | ||
"engine": "node >= 0.8.9" | ||
} |
# CrushIt | ||
CrushIt is a commandline tool for compiling, concatenating, and minifying scripts from a web page. I wrote CrushIt to make it easy to optimize my code for use in production. | ||
CrushIt is a commandline tool for crawling web pages and compiling scripts. | ||
@@ -16,3 +16,3 @@ [![Build Status](https://travis-ci.org/qawemlilo/crushit.png)](https://travis-ci.org/qawemlilo/crushit) | ||
# Basic usage | ||
crushit [options] [url] | ||
crushit [options] [url] [file] | ||
@@ -29,3 +29,3 @@ | ||
## Perform maximum optimisation | ||
crushit -m [url] | ||
crushit -x [url] [output filename] | ||
@@ -37,6 +37,9 @@ | ||
## CLI Example | ||
## CLI Examples | ||
``` | ||
# Compiling scripts from my website | ||
crushit http://www.rflab.co.za | ||
# Compiling scripts from my website with default options | ||
crushit http://www.ragingflame.co.za | ||
# Compiling scripts from my website with options and specifying an output file | ||
crushit -xm http://www.ragingflame.co.za crushed.js | ||
``` | ||
@@ -48,9 +51,11 @@ | ||
crushit.crushScripts(url, options); | ||
crushit.squeeze(options, callback); | ||
# options | ||
beatify - Beautify output code | ||
max - Perform maximum optimisation | ||
comments - Include comments in the output code | ||
onComplete - Callback function that takes on argument | ||
website - (String) Web page URL | ||
comments - (Boolean) Keep comments | ||
beatify - (Boolean) Beautify output code | ||
mangle - (Boolean) Mangle variable names | ||
max - (Boolean) Perform maximum optimisation | ||
callback - (Function) Callback function that takes 2 arguments, the first one is an error flag or object and the second one is the output code | ||
``` | ||
@@ -63,17 +68,16 @@ | ||
crushit.crushScripts("http://www.rflab.co.za", { | ||
beautify: true, | ||
max: false, | ||
comments: true, | ||
onComplete: function (error, code) { | ||
if (error) { | ||
console.log(error.msg); | ||
} | ||
else { | ||
console.log(code); | ||
} | ||
crushit.squeeze({ | ||
website: "http://www.ragingflame.co.za", | ||
comments: false, | ||
beatify: false, | ||
mangle: true, | ||
max: true, | ||
}, | ||
function (error, code) { | ||
if (error) { | ||
console.log(error.msg); | ||
} | ||
else { | ||
console.log(code); | ||
} | ||
}); | ||
@@ -83,7 +87,20 @@ ``` | ||
## To Do | ||
## Short Code | ||
- Add css minification | ||
- Write better docs | ||
The `options` argument may also be a string variable | ||
``` | ||
var crushit = require("crushit"); | ||
crushit.squeeze("http://www.ragingflame.co.za", function (error, code) { | ||
if (error) { | ||
console.log(error.msg); | ||
} | ||
else { | ||
console.log(code); | ||
} | ||
}); | ||
``` | ||
## License | ||
@@ -90,0 +107,0 @@ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
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
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
198370
13
845
1
110
0
3
2
+ AddedCSSselect@0.4.1(transitive)
+ AddedCSSwhat@0.4.7(transitive)
+ Addedasn1@0.1.11(transitive)
+ Addedassert-plus@0.1.5(transitive)
+ Addedasync@0.2.100.9.2(transitive)
+ Addedaws-sign2@0.5.0(transitive)
+ Addedboom@0.4.2(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcheerio@0.13.1(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedcommander@2.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcryptiles@0.2.2(transitive)
+ Addedctype@0.5.3(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addeddomhandler@2.2.1(transitive)
+ Addeddomutils@1.3.01.4.3(transitive)
+ Addedforever-agent@0.5.2(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedhawk@1.0.0(transitive)
+ Addedhoek@0.9.1(transitive)
+ Addedhtmlparser2@3.4.0(transitive)
+ Addedhttp-signature@0.10.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedmime@1.2.11(transitive)
+ Addednode-uuid@1.4.8(transitive)
+ Addedoauth-sign@0.3.0(transitive)
+ Addedqs@0.6.6(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedrequest@2.34.0(transitive)
+ Addedsntp@0.2.4(transitive)
+ Addedsource-map@0.1.34(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedtldts@6.1.48(transitive)
+ Addedtldts-core@6.1.48(transitive)
+ Addedtough-cookie@5.0.0(transitive)
+ Addedtunnel-agent@0.3.0(transitive)
+ Addeduglify-js@2.4.24(transitive)
+ Addeduglify-to-browserify@1.0.2(transitive)
+ Addedunderscore@1.5.2(transitive)
+ Addedwindow-size@0.1.0(transitive)
+ Addedwordwrap@0.0.2(transitive)
+ Addedyargs@3.5.4(transitive)
- Removedboolbase@1.0.0(transitive)
- Removedcheerio@0.10.8(transitive)
- Removedcheerio-select@2.1.0(transitive)
- Removedcommander@1.1.1(transitive)
- Removedcss-select@5.1.0(transitive)
- Removedcss-what@6.1.0(transitive)
- Removeddom-serializer@2.0.0(transitive)
- Removeddomelementtype@2.3.0(transitive)
- Removeddomhandler@2.0.35.0.3(transitive)
- Removeddomutils@1.0.13.1.0(transitive)
- Removedentities@4.5.0(transitive)
- Removedhtmlparser2@2.6.0(transitive)
- Removedkeypress@0.1.0(transitive)
- Removednth-check@2.1.1(transitive)
- Removedoptimist@0.3.7(transitive)
- Removedrequest@2.12.0(transitive)
- Removedsource-map@0.1.43(transitive)
- Removeduglify-js@2.2.5(transitive)
- Removedunderscore@1.4.4(transitive)
- Removedwordwrap@0.0.3(transitive)
Updatedcheerio@~0.13.1
Updatedcommander@~2.1.0
Updatedrequest@~2.34.0
Updateduglify-js@~2.4.12