Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Application and asset management to die for.

branch: gh-pages

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 javascripts
Octocat-spinner-32 stylesheets
Octocat-spinner-32 templates
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CNAME
Octocat-spinner-32 README.md
Octocat-spinner-32 index.html
Octocat-spinner-32 index.jade
Octocat-spinner-32 params.json
README.md

Die

Application and asset management to die for.

Features

Razor-sharp Express DSL

Die supports a Zappa-ish DSL for Express:

die = require('die')
    base: __dirname

app = die.createServer ->
  @set 'view options'
    layout: false

  @get '/', ->
    @render 'index'

  @get '/json', ->
    @json
      x: 1
      y: 2
      z: 3

CommonJS module support

Use CommonJS modules in the browser (courtesy of Browserify):

class HomeView extends Backbone.View
  template: require './templates/home'
  render: ->
    @$el.html @template()
    @

Here we are requiring a Jade template (which is compiled to an optimized function) in our Backbone view.

Stylus with nib and Bootstrap baked in

Modernize your CSS with Stylus! Bootstrap and nib baked in:

// everything
@import 'bootstrap'

// only config and forms
@import 'bootstrap/config'
@import 'bootstrap/forms'

h1
  font-size 20px

Awesome testing with Mocha

Mocha has emerged as the best-in-class JavaScript test framework, and Die supports it out of the box.

Multi-app support

By default each app created by Die is reusable by other [Die][die]/Express apps. Example configuration:

die = require('die')
  base: __dirname

app = die.createServer ->
  @use '/app2', require 'app2'
  @use '/app3', require 'app3'
  @use '/app4', require 'app4'

module.exports = app

Each app can of course require other apps recursively.

Project Templates

Never write boilerplate code again, take advantage of Die's project templates. Structure your projects however you like, each file in a template folder will be treated as a Mustache template and can be passed any sort of arbitrary variables when creating a new project with die new. Check out the default templates for examples.

Usage

Create new project based off template:

die new <name> [--template <template name>, --install, --production]

Serve project (or just static files):

die run

Compile client-side assets:

die build

Can also be used to build stand-alone CSS and JavaScript assets:

die build --minify --css [in] --css-path [out] --js [in] --js-path [out]

Compile & watch client-side assets, recompiling on change:

die watch

Run tests:

die test
Something went wrong with that request. Please try again.