The JavaScript Task Runner
npm install -g grunt-cli
npm install grunt --save-dev
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
options: { ... }
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jshint']);
};
Sometimes Grunt - is all you need to automate your development routine.
Easy start, reliable solutions, all this.
Do not expect a miracle from it though, in the end, it's just a beast.
Automate and enhance your workflow
npm install --global gulp
npm install --save-dev gulp
gulpfile.js
'use strict';
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var DEST = 'build/';
gulp.task('default', function() {
return gulp.src('foo.js')
// This will output the non-minified version
.pipe(gulp.dest(DEST))
// This will minify and rename to foo.min.js
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(DEST));
});
If you need task-runner and love Grunt,
but prefer Code over Configuration
Gulp is definitely your cup of tea!
Ultra-fast HTML5 build tool
npm install -g brunch
brunch new [skeleton-URL] [optional-output-dir]
brunch watch --server
brunch new [skeleton-URL] [optional-output-dir]
# Example from GitHub
brunch new gh:brunch/dead-simple
# Example from a full URL
brunch new https://github.com/paulmillr/brunch-with-chaplin
config.coffee
exports.config =
# See http://brunch.io/#documentation for docs.
files:
javascripts:
joinTo:
'javascripts/app.js': /^app/
'javascripts/vendor.js': /^(?!app)/
stylesheets:
joinTo: 'stylesheets/app.css'
templates:
joinTo: 'javascripts/app.js'
If you seem to be tired of Grunt and Gulp and crave for hipster tools to build your next project - take a look at Brunch!
It could become a long-term relationship.
JS port of Sprockets by Nodeca
Sprockets is a Ruby library for compiling and serving web assets. It features declarative dependency management for JavaScript and CSS assets, as well as a powerful preprocessor pipeline that allows you to write assets in languages like CoffeeScript, Sass, SCSS and LESS.
Check out Middleman for examples and docs
$ mincer --include assets/javascripts \
--include assets/stylesheets \
--output public/assets \
application.js application.css
var connect = require('connect');
var Mincer = require('mincer');
var environment = new Mincer.Environment();
environment.appendPath('app/assets/javascripts');
environment.appendPath('app/assets/stylesheets');
var app = connect();
app.use('/assets', Mincer.createServer(environment));
app.use(function (req, res) {
// your application here...
});
var asset = environment.findAsset('application.js');
asset.toString(); // resulting contents
asset.length; // length in bytes
asset.mtime; // last modified time
asset.pathname; // full path on the filesystem
Mincer is truly a gift to all Ruby fans!
For all non-familiar-with-Ruby developers though it may provide a tough experience
Broccoli.js – The asset pipeline for ambitious applications.
npm install --save-dev broccoli
npm install --global broccoli-cli
var concat = require('broccoli-concat'),
pickFiles = require('broccoli-static-compiler'),
mergeTrees = require('broccoli-merge-trees');
// concat the JS
var scripts = concat('app/', {
inputFiles: ['**/*.js'],
outputFile: '/assets/scripts.js'
});
// concat the CSS
var styles = concat('app/styles', {
inputFiles: ['**/*.css'],
outputFile: '/assets/styles.css'
});
// grap any static assets
var public = pickFiles('public', {
srcDir: '.',
destDir: '.'
});
// and merge all the trees together
module.exports = mergeTrees([scripts, styles, public]);
Inspired by Rails asset pipeline, Broccoli offers backend-agnostic functionality with NodeJS
If you need for speed (perhaps on complex project), you should give it a try!
Flexible, minimalistic, multi-platform static site generator built on top of node.js
npm install wintersmith -g
wintersmith new [project]
cd [project]
wintersmith preview
wintersmith build
A wintersmith site is built up of three main components: contents, views and templates
Wintersmith is definitely the right choice if you are into Coffescript, Jade and have some background with Jekyll.
It allows to build static site or simple blog, but requires some developing skills
Punch is a simple, intuitive web publishing framework that will delight both designers and developers
# Install Punch
npm install -g punch
# Create your site
punch setup mysite
Lakshan Perera edited this page on 25 Sep 2012
Punch.io is nice tool to use for small sites or blogs, if you don't want to mess with Grunt or Gulp and other tech magic.
Best thing to do - use it "as is"
Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt, Less.js / lesscss.org, Topcoat, Web Experience Toolkit, and hundreds of other projects to build sites, themes, components, documentation, blogs and gh-pages.
assemblefile.js
var assemble = require('assemble');
var less = require('gulp-less');
assemble.task('html', function() {
assemble.src('templates/*.hbs')
.pipe(assemble.dest('dist/'));
});
assemble.task('default', ['html']);
Assemble.io shows it's best in delivering documentation presentation using numbers of similar pages.
Having somehow different structure may lead to surprises in development.
Requires time to get into
An extremely simple, pluggable static site generator.
Since everything is a plugin, the core library is actually just an abstraction for manipulating a directory of files.
npm install metalsmith
metalsmith.json
{
"metadata": {
"title": "My Blog",
"description": "My second, super-cool blog."
},
"plugins": {
"metalsmith-markdown": {},
"metalsmith-permalinks": {
"pattern": ":title"
},
"metalsmith-templates": {
"engine": "handlebars"
}
}
}
build.js
var async = require('async');
var Metalsmith = require('metalsmith');
var prompt = require('cli-prompt');
var render = require('consolidate').handlebars.render;
var metalsmith = Metalsmith(__dirname)
.use(ask)
.use(template)
.build(function(err){
if (err) throw err;
});
Metalsmith is brought to you by...
Great idea of atomic structure allows familiar piping pattern to generate a site... or build docs... orlaunch a rocket
In some ways, though, it could be considered an unnecessary complexity of some sort
A fast, simple & powerful blog framework
npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server
Hexo is a right tool to use if you are totally aware of what you doing (blogging)
(blogging generators)
(due to maintaining reasons)
a build tool for modern web development
The more time spent looking at config, the more time spent understanding it, and playing with it, then the less time is spent actually writing code.
Limits I/O, so It Is Fast(Mimosa reads and writes once)
npm install -g mimosa
mimosa new [applicationName]
or
mimosa skel:list
skel:new [nameOfSkeleton] [directory]
mimosa-config.js
exports.config = {
"modules": []
}
mimosa watch
Mimosa is the project, absolutely worth seeing and giving a try!
It is too complex for plain structured static sites, but definitely will shine in application development.
More from the author and maintainer:
Extracting text from files of various type including html, pdf, doc, docx, xls, xlsx, pptx, png, jpg, gif, rtf, text/*.
The static web server with built-in preprocessing.
Harp serves Jade, Markdown, EJS, CoffeeScript, Sass, LESS and Stylus as HTML, CSS & JavaScript—no configuration necessary.
focus on writing instead of wrangling)
Effortless web publishing through Dropbox
npm install -g harp
harp init myproject
harp server myproject
./myproject
harp compile
HarpJS is a solid ready-to-use solution for building/serving regular static sites.
It is also possible to use it as blogging platform
Do not expect something extraordinary though, it is perfect when used as intended.
Nothing wrong with these guys,
they just don't quite fit the categories
The Web's scaffolding tool for modern webapps
a task-runner
instead - it utilizes the power of Grunt and Gulp!
a one-framework solution
the direction of development implies multiple framework support
npm install -g yo bower grunt-cli gulp
npm install -g generator-webapp
yo webapp [--param]
(only used on project init)
yo webapp
gulp serve
gulp test
gulp
yo webapp
grunt serve
grunt test
grunt
Yeoman is a brilliant tool for starters, digging into the webapp development world.
On the other hand, yo keeps you away from scaffolding, offering opinionated structure from the very start.
A rapid front-end development toolset for Mac & Windows.
Focus on the build not the setup.
Preprocessing, templating, building, minification, combining, optimisation, linting, data processing, ...
Mixture offers all-in-one suite application for modern approach to static sites development
It will never bother you with Grunt-Gulp-Webpack-Browserification.
Swift start for non-developers!