freddies
The Zero-Dependency Left-To-Right Function Composer!
What's A "Freddy"?
That's a term I just made up for a process defined as array of functions!
...it also comes from Function-Reducible Array
Show Me!
Don't Do This:
// NO! Pyramid of DOOM! Reversed Process Order!const foo = ;
Do This Instead!
// YES! Freddies are defined as ordered steps!const myFreddy = doFirstThing doSecondThing doThirdThing doLastThing; // Freddy to function!const doSomeThings = ; // And done!const foo = ;
Or Even Skip the Explicit Array Declaration!
const doSomeThings = ; const foo = ;
Got An Async Process?
Freddies understand promises!
const findUserByName = { return dbusers }; const activateUser = { useractivated = true; return user;}; // Freddy to function!const activateByName = ; // Invoke and catch errors like usual;
Got a Complex Multi-Stage Process?
Freddies can contain other freddies!
const access = readSession checkPermissions const sanitizeForm = sanitizeXss sanitizeSqlInject const validateForm = checkNonce validateCommentconst clean = sanitizeForm validateForm;// clearly-defined flow ;
Shut up and take my money!
Installation (npm):
npm install --save freddies
For the import
-ers:
;
For the require
-ers:
var f = default;