0.2.2 • Published 12 years ago
typedjs v0.2.2
node-typedjs
This is the TypedJS module for node.js
TypedJS lets you annotate your JavaScript functions with Haskell-like type signatures and then runs a set of automated tests against those functions.
For more information visit the TypedJS GitHub repo
Install
In your project
npm install typedjsGlobally to check all your projects
npm install typedjs -gAPI
Adding single tests and running them
var typedjs = require('typedjs');
typedjs.addTest('foo :: Number -> Number', function foo(n) {
return n;
});
typedjs.runTests(); // will output to console.logYou can also use a callback if you prefer
typedjs.runTests(function (data) {
// the data that would've been passed to console.log
// is sent here instead.
});Running against a file
var typedjs = require('typedjs');
var path = require('path');
typedjs.runTests(path.join(__dirname, 'myFile.js'), function (data) {
// this is an optional callback
// data will be sent to console.log by default.
});Comes with an executable
$ typedjs your_file.jsCredits
- TypedJS - Ethan Fast
- node-typedjs - Josh Perez