docvy-utils
installation:
⇒ npm install docvy-utils
the utilities:
var utils = require("docvy-utils");
The exported module object has all the properties from the module object from the built-in util
module i.e. require("util")
is cloned to the above export module object.
utils.defineCallback([callback])
Always returns a function that can be used in place of a callback, if none has been passed in your function. This is a convenience function that avoids the need to keep checking if a callback was passed before calling it, in program logic.
callback
(Function):
- you would normally pass the parameter suspected to be the callback.
- if it is not a function, a new function will returned instead.
utils.getPath(pathname)
Returns application-specific paths. These paths are absolute.
pathname
(String):
- can be any of:
app.home
: application user/home directoryapp.cache
: directory for all application cachesapp.cache.plugins
: directory for plugin handler's cacheapp.logs
: directory for logsapp.plugins
: directory for user-installed plugins
- if it does not match any of the above,
null
is returned.
Note: The target path is created if not yet existent.
license:
The MIT License (MIT)
Copyright (c) 2015 Forfuture we@forfuture.co.ke
Copyright (c) 2015 GochoMugo mugo@forfuture.co.ke