0.2.3 • Published 10 years ago

manchu v0.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

manchu

fu manchu does not obtain his mighty 'stache without, first, pre-compiling it.

about

manchu is an easy way to create build directives at your application runtime. it supports the following otherwise manual tasks:

  • handlebars template pre-compilation
  • css/less concatenation and compilation
  • javascript compression and concatenation

installation

$ npm install manchu

usage

this example illustrates how you might do the following:

  1. precompile a directory of handlebars templates
  2. uglify a directory of javascript files
  3. concatenate selected css and less files and minify
var manchu = require('manchu')
  , templates
  , scripts,
  , styles;

templates = manchu.createDirective({
	type : 'handlebars',
	input : __dirname + '/templates',
	output : __dirname + '/public/scripts/templates.js'
});

scripts = manchu.createDirective({
	type : 'javascript',
	input : __dirname + '/scripts',
	output : __dirname + '/public/scripts/app.js'
});

styles = manchu.createDirective({
	type : 'stylesheet',
	input : __dirname + '/styles',
	output : __dirname + '/public/styles/styles.css'
});

manchu.build([
	templates,
	styles,
	scripts
], function() {
	// start your server or something
});

public api

manchu.createDirective(options)

Returns a new Directive instance. The argument options takes the following properties.

  • type - String ('handlebars', 'javascript', 'stylesheet') * Type will determine whether to precompile handlebars templates, uglify JavaScript files, or compile LESS
  • input - String or Array This can be a string path to a directory of files to use or and array of individual files or directories The directory read is not recursive and will only read the immediate children of the directory
  • output - String * Path to the desired output file.

manchu.build(directives, callback)

Accepts an array of Directives and executes them in sequence.

  • directives - Array * Pass an array of manchu.Directive instances
  • callback - Function * Gets called upon successful build of all directives

Returns a new instance

class reference

manchu.Builder

manchu.Directive

0.2.3

10 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago