fattr
function attributes
usage
var fattr = var fn = // =>// fn.attribute == true// fn.authenticated == true// fn.version = 5
about
JavaScript only lets you declare a function name when creating a function (and even that's not specified/poorly implemented piror to ES6). Sometimes you might want to add other metadat to a function.
We could do:
var { // stuff}fnattr = truefnother = origin: 'earth'
But with long function bodies, this pushes important information to the bottom, where it might not be seen by someone reading through code quickly.
Borrowing from other programming languages, like C#, fattr
lets us attach declarative attributes to our functions, giving us data we can work with elsewhere to extend or modify the behavior of our programs:
var fn =
installation
$ npm install fattr
running the tests
From package root:
$ npm install
$ npm test
contributors
- jden jason@denizac.org
license
MIT. (c) MMXIII AgileMD http://agilemd.com