1.2.1 • Published 8 years ago

surmount v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

surmount

Minimal, well behaved dependency based scheduler

Getting Started

$ npm install --save surmount

Features

  • Optimized for parallel execution
  • Propagates arguments to the functions
  • Propagates errors to the affected functions
  • Returns a promise of an object containing return values and/or errors
  • Throws an error on circular dependencies
  • Throws an error on missing dependencies
  • Not an orchestrator, task registry or a build system

Usage

// example.js

const tie = function (err) {
	if (err) {
		throw err
	}

	console.log('Tied the double windsor knot.')
}

tie.label = 'tie'
tie.dependency = ['shirt']

// ...

const dress = new Surmount([
	tie,
	shoes,
	jacket,
	shirt,
	pants
])

dress()
.then(function (result) {
	console.log(result)
})

// That pair of grey wool trousers.
// Pale blue shirt to go under the jacket.
// Not sure how to wear a tweed jacket with the rest of the pieces.
// Took a pair of brown suede shoes out of the box.
// Tied the double windsor knot.

 

License

Copyright (c) 2016 Mark Milstein mark@epiloque.com

surmount is licensed under the MIT License

http://www.opensource.org/licenses/MIT