toolkit for js1k
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
compiler
README.md
crushed.html
crushed.js
externs.js
index.html
jscrush.js
minified.html
minified.js
process.js
source.html
source.js

README.md

##js1k-tools

Blog post to come..

js1k-tools combies the js1k spring 2013 shim, closure compiler, the awesome JSCrush with a node.js script to make life a little easier writing and packing 1k apps.

It faciliates offline js1k work, and reduces the need to copy and paste code between the browser-based minifiers and compressors.

###Instructions

  1. write your code in source.js
  2. test your code with source.html
  3. compile your code with node process.js
  4. test minified.html and crushed.html

While working on my js1k entry, I found it useful to have this environment/boilerplate/toolkit. (Sidenote: Any serious javascript developers should try writing an application in 1024 bytes at least once!)

Each javascript file accompanying html files comes with each respective, so its easy to check what stops working along the way.

source.html / source.js -> your raw unminified source code

minified.html / minified.js -> minified source generated by the closure compiler

crushed.html / crushed.js -> the final compressed code

externs.js - for declaring variables to be untouch by closure.

###Updates Supports uglify-js compiler now. uglify-js can be installed by running npm install uglify-js. Overall compression may be less but compiling is much faster.

###TODO Add Siorki's RegPack to save more bytes!

questions or comments? ask @blurspline