Classes
Members
(inner) RetObject this is my standard way of returning stuff success tells you wether the function successfuly executed or not, msg: is a frendly message of what happened data is any data you wish to return and debug is for debug error messaged or any other developer data
Methods
(static) fileHash()
https://gist.github.com/GuillermoPena/9233069?permalink_comment_id=2364896#gistcomment-2364896
(static) groupBy(xs, key) → {Object}
Groups array by key https://stackoverflow.com/questions/14446511/most-efficient-method-to-groupby-on-an-array-of-objects
Parameters:
| Name | Type | Description |
|---|---|---|
xs |
Array | the array to group |
key |
string | the key to groupby |
Returns:
- Type
- Object
(static) logfn(str)
Returns a function that logs the params its called with its parameters
Parameters:
| Name | Type | Description |
|---|---|---|
str |
a prefex string(s) |
Returns:
(static) pgExecute(pg, stmt, successMsgopt) → {Promise.<RetObject>}
Execute a slq statement on a pg pool or client
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
pg |
pg.Pool | pg.Client | the pool or client to use to execute the statement. | |
stmt |
string | the sql statement to execute | |
successMsg |
string |
<optional> |
The message to send on success |
Returns:
- fills in data if success and debug with error if failed;
- Type
- Promise.<RetObject>
(static) simpleExec(sh, cb)
Execute and logs stdout/err (spans a process internally and returns it)
Parameters:
| Name | Type | Description |
|---|---|---|
sh |
the shell command as you would type it | |
cb |
cb(data, done) whenever stdout is received |
(static) unGroup(grp) → {Array}
Undoes what groupBy() does
Parameters:
| Name | Type | Description |
|---|---|---|
grp |
Object | Object with arrays of values |
Returns:
-the original arrays
- Type
- Array