Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Kicker, but not broken, and written for node.js
CoffeeScript Perl JavaScript
branch: master
Failed to load latest commit information.
bin fixed a bug that kept the cli app from running at all... you have to …
lib/kckr added node_modules to gitignore
src version rollback, and inc_version fix
.gitignore
.npmignore converted kckr args into one object, moved regex logic into class, no…
.travis.yml
Makefile
README.md added kickonce to cli options, wont watch, will kick once, and then e…
package.json

README.md

kckr

Build Status

what is it?

Kicker, watchr, live reload... There's a million and one scripts out there that will take an action when files you're watching have changed. Kckr just actually works. It would appear as though all of the others have fatal bugs. Mine requires node, but just works out of the box afterward, damnit!

Also, I should say that I shamelessly took the technique from CoffeeScript's command line app. They got it right, and they're the only ones I know of that have a watcher that works reliably.

installing

First, you need node.js, and npm. Once you got that part down, do the following.

npm install -g kckr

how do I use it?

The help output says:

Usage: kckr [options] path/to/watch

-e, --execute      cmd to execute upon file change. use {}, {source}, {basename}, {basename_noext}, {dirname} for path placeholder(s).
-k, --kickonce     just traverse the dir, exec on each match, and quit. don't do any watching, just do the kicking. (used in my `make build` -- check it out!)
-p, --path         path to dir, or file to watch.
-r, --pattern      pattern for filenames to match if watching a dir.
-h, --help         display this help message
-v, --version      display the version number

So, if you want to compile less css files from one dir into another dir on every file change and your directory structure looked like this:

static/
  |->  less
  +->  css

You could do this:

kckr -e "lessc {source} > static/css/{basename_noext}.css" -r ".*\.less" static

Got it? Maybe not? read it a few more times...

checkout the watch portion of the make file to see how I build my coffeescript while editing.

tokens

{}, {source} - full relative path to file with extension. (ex. static/less/styles.less)
{basename} - just the filename.  (ex. styles.less)
{basename_noext} - Just the filename, sans extension. (ex. styles)
{dirname} - everything but the filename. (ex. static/less/)
{nobase} - source sans the starting dir. (ex. less/styles.less)
{nobase_noext} - source sans the starting dir, sans the extension. (ex. less/styles)

get in touch

http://twitter.com/#!philipthrasher

http://philipthrasher.com

or

philipthrasher[at) gmail (dot]com

Something went wrong with that request. Please try again.