Socket
Socket
Sign inDemoInstall

crushit

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crushit - npm Package Compare versions

Comparing version 0.2.5 to 0.3.0

lib/crushit.js

2

index.js
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

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