Code Monkey home page Code Monkey logo

node-template's Introduction

node template projects

This is a collection of node template projects.

  • [master] single-page application

single-page application project

Install with:

git clone --depth=1 -b master [email protected]:EndangeredMassa/node-template.git && cd node-template && rm -rf .git

The following primary technologies are used herein.

code

  • coffeescript
  • stylus
  • facile
  • express

test

  • mocha
  • assertive
  • bond
  • testium

build

  • gulp
  • browserify

tasks

The standard npm test and npm start do what you would expect. Beyond that, gulp is used as a simple task runner and build system. The definition for the the tasks can be found under /tasks.

.
├── gulpfile.js
└── tasks
    ├── clean.coffee
    ├── gulp-digest.js
    ├── images.coffee
    ├── index.coffee
    ├── scripts.coffee
    ├── styles.coffee
    ├── templates.coffee
    ├── test.coffee
    └── watch.coffee

The default task is a listing of all tasks.

$ gulp
[gulp] Using gulpfile ~/#{YOUR_PATH}/gulpfile.js
[gulp] Starting 'default'...

Main Tasks
------------------------------
    assets
    clean
    default
    images
    scripts
    styles
    test
    watch

Sub Tasks
------------------------------
    test-scripts

require

For client-side code and unit tests, require has a special enhancement. Any path that starts with ~ refers to the /src.

Model = require '~/entity/model'

when compiled becomes:

var Model = require('/home/someone/node-template/src/entity/model');

This makes it very easy to require code under test. It also makes it easy to jump out of your current directory without an arbitrary number of ../../ trackbacks. This should be done rarely within /src, but you can go nuts under /test.

digest

TODO: explain

/digest.json

NODE_ENV=production

application code

The code itself is structured under /src.

.
└── src
    ├── bootstrap
    │   ├── colors.styl
    │   ├── index.coffee
    │   ├── layout.styl
    │   └── styles.styl
    ├── entity
    │   ├── model.coffee
    │   ├── styles.styl
    │   ├── template.html
    │   └── view.coffee
    └── server
        ├── index.coffee
        └── index.html

It is organized by module, not file type. Any coffeescript, stylus, or html files can be located inside a module's directory. The html can be required as a string, which is often used here by facile to compile it as a template. The server here is just another module.

license

MIT

node-template's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.