Skip to content

Examples built with anvil

arobson edited this page Jan 8, 2013 · 4 revisions

Postal.js is an in-memory message bus - very loosely inspired by AMQP - written in JavaScript. Postal.js runs in the browser, or on the server-side using Node.js. It takes a familiar "eventing-style" paradigm most JavaScript developers are already used to and extends it by providing "broker" and subscriber implementations which are more sophisticated than what you typically find in simple event delegation.

build.json

{
	"anvil.uglify" : {
		"exclude": ["./node/postal.js", "./node/classic-resolver.js"]
	},
	"anvil.http": {
		"paths": {
			"/": "./"
		}
	},
	"anvil.jshint" : {
		"all": true
	},
	"output": {
		"full": "lib",
		"partial": {
			"/browser/postal.*" : [ "./example/standard/js", "./example/amd/js/libs/postal", "./example/node/client/js/lib" ],
			"/node/postal.js"   : "./example/node/messaging"
		}
	},
	"dependencies": [ "anvil.http", "anvil.uglify" ]
}

monologue provides 'event-emitting' functionality - commonly referred to as "pub/sub" - that can be mixed into/inherited by your JavaScript objects.

build.json

{
    "anvil.uglify" : {
        "exclude" : ["./node/monologue.js"]
    },
	"anvil.http" : {
		"paths" : {
			"/"         : "./"
		}
	},
	"dependencies" : [ "anvil.http", "anvil.uglify" ]
}

Machina.js is a JavaScript framework for highly customizable finite state machines (FSMs). Many of the ideas for machina have been loosely inspired by the Erlang/OTP FSM behaviors.

build.json

{
	"anvil.uglify" : {
		"exclude" : ["./node/machina.js"]
	},
	"anvil.http" : {
		"paths" : {
			"/lib"          : "./lib",
			"/ext"          : "./ext",
			"/src"          : "./src",
			"/load"         : "./example/load",
			"/atm"          : "./example/atm",
			"/connectivity" : "./example/connectivity",
			"/spec"         : "./spec",
			"/"             : "./"
		}
	},
	"anvil.jshint" : {
		"all" : true
	},
	"output" : {
		"full" : "lib",
		"partial" : {
			"/browser/machina.*" : [ "./example/connectivity/js/lib/machina" ]
		}
	},
	"dependencies" : [ "anvil.http", "anvil.uglify" ]
}

interpolate.js is a simple string interpolation module for both node.js and web browser use. interpolate may be consumed as a CommonJS module, an AMD module, or as a browser global.

###build.json

{
  "source": "src",
  "spec": "spec",
  "output": "build",
  "dependencies": ["anvil.mocha"]
}

A tiny library that fetches your public IP address from whatismyip.com.

###build.json

{
  "source": "src",
  "output": "build",
  "spec": "spec",
  "dependencies": ["anvil.mocha"]
}