Fly Utilities
Fly is a modern build system for Node based in co-routines, generators and promises.
npm install fly-util
import util from "fly-util"function log (...args)Wrapper for Console.log.
function error (...args)Wrapper for Console.error.
function alert (...args)Wrapper for Console.log in a distinctive color. Set process.env.VERBOSE to show output.
function trace (e)e {Object}error object
Wrapper for prettyjson.
function defer (asyncFunc)asyncFunc {Function}async function of the form (value, options, cb)return{Function}new function that returns a promise
Promisify a function with a callback.
function flatten (array)array {Array}return[[a],[b],[c]] → [a,b,c]
Flatten a nested array recursively.
function filter (pkg, load, blacklist = [], bind = true)pkg {Package}project's package.jsonload {Function}load handlerblacklist {Array}blacklisted pluginsreturn {Array}list of fly dependencies that can be loaded
Find fly-* plugins listed in a package dependencies.
function expand (pattern, options)pattern {String}Pattern to matchhandler {Object}options to globreturn {Promise}
Promisified glob wrapper.
function* find (path, names)path {String}file or path to the Flyfilebind {Function}Optional. use to bind require or process pathreturn {String}path to the Flyfile
Find a valid Flyfile from a given path. If path is a directory find the first Flyfile with a supported extension.
function bind (path, names)path {String}file or path to the Flyfilereturn {String}path to the Flyfile
Bind to node's require based in the file extension of your Flyfile.
Support ES6/7 by default, but Flyfiles can be written in any language supported in interpret.
mz/fspromise wrapped basic IO handlingclorterminal colorsglobexpanding path/file glob patternsprettyjsonpretty formatting for JSON objectsinterpretresolve modules for in-the-fly compilation.update-notifierCLI update notifications
MIT © Jorge Bucaran et al ❤️