fly-utildeprecated

Fly Utilities

Usage no npm install needed!

<script type="module">
  import flyUtil from 'https://cdn.skypack.dev/fly-util';
</script>

README

Fly Utilities

npm package

About | Install | Usage | API

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.json
  • load {Function} load handler
  • blacklist {Array} blacklisted plugins
  • return {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 match
  • handler {Object} options to glob
  • return {Promise}

Promisified glob wrapper.

find

function* find (path, names)
  • path {String} file or path to the Flyfile
  • bind {Function} Optional. use to bind require or process path
  • return {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 Flyfile
  • return {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 handling
  • clor terminal colors
  • glob expanding path/file glob patterns
  • prettyjson pretty formatting for JSON objects
  • interpret resolve modules for in-the-fly compilation.
  • update-notifier CLI update notifications

License

MIT © Jorge Bucaran et al :heart: