node package manager


Mission: common tasks in Web development

Bundled tasks for developing single page apps.


npm install --save-dev mission shelljs

Config in CoffeeScript or JavaScript:

#!/usr/bin/env coffee 
require 'shelljs/make'
mission = require 'mission' = ->
    from: 'src/'
    files: ['''dir/']
    to: 'lib/'
      bare: yes

Here's mine:

Run it like this:

chmod +x
./ coffee

or like me:

alias mk='coffee'
mk coffee

Other configurations

Say if you want to compile only one file: = ->
    file: ''
    from: 'src/'
    to: 'lib/'
      bare: yes

Or you may need to find some files that are deep in folders: = ->
    find: /\.coffee$/
    from: 'src/'
    to: 'lib/'
      bare: yes

from and to are optional, you mat only need to write file sometimes: = ->
    file: 'dir'
    trigger: (filename, extname) ->


  • tree: creates file tree

  • bump: bump version with semver.

  • uglify: minify JavaScript code

  • coffee: compile CoffeeScript to JavaScript, with sourceMap support

  • watch: watch directories, callback filenames and extnames

  • time: log the time it cost

  • realod: reload tab with devtools-reloader-station

  • browserify: combine JavaScript code on CommonJS

  • browserifyVender: helper for browserify to generate vender.js

  • cssmin: combine CSS files and minify code

  • dot: precompile dot files to JavaScript

  • jade: compile Jade to HTML

  • less: compile LESS to CSS

SourceMap is enabled by default, and here I have to use command line. Related to: Anyway, mission.less needs to be updated in the future.

  • rsync: run Rsync with some default configs

  • copy: copy files and directories

  • wait: wait chan.done = false to be true and run task

  • cirruHtml compile Cirru HTML

  • cirruHtmlJs compile Cirru to template in JavaScript(not tested)


Asynchronous callings are hard to handle in ShellJS. In this angle, Grunt did a good job in sequencing tasks.

But you can try wait to reduce the pain. mission would keep watching .done and run task when it's true.

target.test = ->
  = done: no
  mission.wait a->
    console.log 'finish task'
  setTimeout ->
    a.done = yes


Compile *.coffee:

./ compile


  • 0.0.8

    • add external option for browserify

    • add browserifyVender task for multiple bundling

  • 0.0.7

    • Add cirruHtmlJs and rename cirruHtml
  • 0.0.6

    • Updated Cirru HTML to fix double quote in attributes
  • 0.0.5

    • Added sourceMap support
  • 0.0.4

    • Added flexibility and some default options to rsync