fly-util v4.4.1
Fly Utilities
About
Fly is a modern build system for Node based in co-routines, generators and promises.
Install
npm install fly-util
Usage
import util from "fly-util"
API
log
function log (...args)
Wrapper for Console.log
.
error
function error (...args)
Wrapper for Console.error
.
alert
function alert (...args)
Wrapper for Console.log
in a distinctive color. Set process.env.VERBOSE
to show output.
trace
function trace (e)
e {Object}
error object
Wrapper for prettyjson
.
defer
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.
flatten
function flatten (array)
array {Array}
return
[[a],[b],[c]] → [a,b,c]
Flatten a nested array recursively.
filter
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.
expand
function expand (pattern, options)
pattern {String}
Pattern to matchhandler {Object}
options to globreturn {Promise}
Promisified glob wrapper.
find
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.
bind
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.
Dependencies
mz/fs
promise wrapped basic IO handlingclor
terminal colorsglob
expanding path/file glob patternsprettyjson
pretty formatting for JSON objectsinterpret
resolve modules for in-the-fly compilation.update-notifier
CLI update notifications
License
MIT © Jorge Bucaran et al :heart:
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago