0.0.5 • Published 8 years ago

pacul v0.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

Quickstart

var pacul = require('pacul');

pacul.showStatus(1, 'success');
pacul.debug('This is debug message.');
pacul.showLog('debug', 'This is also debug message.');

Functions

showStatus(code, message) ⇒ object

showStatus

show status of transaction.

Status code consist of:

CodeStatus
1success
2sent
3corrupt
4queueing
5fail
6created
7forbidden
9unknown error

Kind: global function
Returns: object - object json object of status

ParamTypeDescription
codeintegerStatus code
messagestringMessage shown to status

isEmptyObject(obj) ⇒ Boolean

Fungsi ini akan menguji object, apakah object tersebut kosong atau tidak.

Kind: global function
Returns: Boolean - boolean return value, true if empty, or false otherwise.

ParamTypeDescription
objObjectTested Object

uniq(an) ⇒ Object

Find unique content of object

Kind: global function
Returns: Object - Unique result object

ParamTypeDescription
anObjectAsserted object

namespace(name, separator, container, val) ⇒ Object

Change string to namespace change path like this "/path/to/some/file.js" into path.to.some.file

Kind: global function
Returns: Object - Nested object result

ParamTypeDescription
nameStringSeparated string
separatorStringSeparator of string
containerObjectTarget object
valMixedContent of target object

isjson(obj) ⇒ Boolean

Function to check if input object is json or not

Kind: global function
Returns: Boolean - Return True if input is json, or False otherwise.

ParamTypeDescription
objstringString object to check.

showLog(String, String) ⇒

Show log to console depend on config level.

Kind: global function
Returns: String String shown to console.

ParamDescription
Stringtype Type of log, it can be info, error, or debug.
Stringmsg Message that want to shown on console.