pacul v0.0.5
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:
Code | Status |
---|---|
1 | success |
2 | sent |
3 | corrupt |
4 | queueing |
5 | fail |
6 | created |
7 | forbidden |
9 | unknown error |
Kind: global function
Returns: object - object json object of status
Param | Type | Description |
---|---|---|
code | integer | Status code |
message | string | Message 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.
Param | Type | Description |
---|---|---|
obj | Object | Tested Object |
uniq(an) ⇒ Object
Find unique content of object
Kind: global function
Returns: Object - Unique result object
Param | Type | Description |
---|---|---|
an | Object | Asserted 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
Param | Type | Description |
---|---|---|
name | String | Separated string |
separator | String | Separator of string |
container | Object | Target object |
val | Mixed | Content 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.
Param | Type | Description |
---|---|---|
obj | string | String object to check. |
showLog(String, String) ⇒
Show log to console depend on config level.
Kind: global function
Returns: String String shown to console.
Param | Description |
---|---|
String | type Type of log, it can be info, error, or debug. |
String | msg Message that want to shown on console. |
8 years ago