Collection of select JavaScript-based command-line tools
Pull request Compare This branch is 15 commits behind ariya:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cssbeautify
cssmin
deploy
jsbeautify
jshint
jslint
lib
CMakeLists.txt
ChangeLog
README.md
configure

README.md

EightPack

EightPack is a collection of JavaScript-based command-line tools for web developers. It uses Google V8 as the scripting engine.

EightPack can be built on all major desktop platforms (Windows, Mac OS X, Linux). Binaries are available for Windows and Mac OS X.

As of now, EightPack consists of the following tools: JSLint, JSHint, JS Beautifier, CSS Beautify, and cssmin.js.

JSLint

JSLint is the famous code static analysis tool from Douglas Crockford.

The command-line version inside EightPack currently uses JSLint edition 2011-07-04.

JSLint customization options are supported via the command-line arguments. Example:

jslint --eqeq=true --continue=false --maxerr=100

which would tolerate == and != but would not tolerate the use of continue statement and stop after encountering 100 errors.

To see the usage and the list of all supported options, run:

jslint --help

JSHint

JSHint is a community-driven tool to detect errors and potential problems in JavaScript code. It is a fork of JSLint.

The command-line version inside EightPack currently uses JSHint edition 2011-04-16.

JSHint customization options are supported via the command-line arguments. Example:

jshint --white=true --rhino=true --maxerr=42

which would enforce whitespace rules, define Rhino environment globals, and stop after encountering 42 errors.

To see the usage and the list of all supported options, run:

jshint --help

Note: The same command-line argument for JSLint may result in different behavior with JSHint, check the documentation for details.

JSBeautifier

JSBeautifier is a tool (written by Einar Lielmanis) to format and indent JavaScript code.

The command-line version inside EightPack currently uses JSBeautifier from revision 5d37b7e9 (dated 2011-06-27).

To see the usage and the list of all supported options, run:

jsbeautify --help

CSS Beautify

CSS Beautify is a tool to reindent and reformat styles written in CSS.

The command-line version inside EightPack currently uses CSS Beautify from revision d4fedf02 (dated 2011-07-01).

To see the usage and the list of all supported options, run:

cssbeautify --help

cssmin.js

cssmin.js is a JavaScript port of YUICompressor's CSS minifier. It is useful to reduce the size of CSS files.

The command-line version inside EightPack currently uses cssmin.js from YUI Compressor 2.4.6 (dated 2011-04-15).

To see the usage and the list of all supported options, run:

cssmin --help

Build Instructions

Tip: when using multicore CPU, speed up the build with parallel jobs, e.g: make -j4.

Mac OS

Requirement: development tools, i.e. by installing Xcode 3.2 or later.

From the Terminal application, run:

./configure
make

To install the executables (with the target directory /usr/local/bin):

make install

Alternatively copy the executables to some directory in the PATH.

Linux

Requirement: C++ compiler and the corresponding libraries (e.g. build-essential package on Ubuntu, gcc-g++ and make packages on OpenSUSE).

From the terminal, run:

./configure
make

To install the executables (with the target directory /usr/local/bin):

make install

Alternatively copy the binaries or executables to some directory in the PATH.

Windows

Requirement: CMake version 2.6 or later and MinGW with g++ 4.4 or later.

From the command-line, run:

cmake -G "MinGW Makefiles" .
mingw32-make

To install the executables, copy all EXE files into a directory in the PATH.

Mini FAQ

Q: How does this differ than Node.JS package or Rhino-based wrapper?

A: Each EightPack's tool is a self-contained, native application. It does not have any run-time dependencies (beside the libraries provided by the operating system). With strip and UPX, the executable generally weighs around 1 MB.

License

Copyright (C) 2011 Ariya Hidayat.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Included Software and Licenses

The following third party software is distributed with EightPack and is provided under other licenses and/or has source available from other locations.