node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Build Status

This package provides several utility functions for the koars framework and its dependencies.


The module exports a single function:

var utils = require('koars-utils')(logOptions);

logOptions is an optional argument.

Returns the name of your program as set in the NAME environment variable. Defaults to koars.


Returns the port of your program as set in the PORT environment variable. Defaults to 3000.


Returns the basepath of your program as set in the BASEPATH environment variable. Defaults to an empty string.

Returns a boolean exclaiming if your program is running in development mode. Defaults to true if the NODE_ENV environment variable is set to anything but production. If NODE_ENV is set to test, the NODE_ENV_TEST variable ist used.


Returns true if NODE_ENV is set to test, false otherwise.


Assigned a bunyan logger. This is either a global logger if the module was called without arguments, or a childlogger of said global logger created via:


If utils.test() returns true, all loggers will dump their output.


An instance of koars-config instantiated to the directory passed in the CONFIG environment variable (defaults to config). This is also run through koars-defaults to assign sane defaults for our application.


An instance of handlebars, to prevent requiring different versions from different submodules.