ezs-basics v3.11.1
A collection of ezs basics functions.
This package cannot be used alone. ezs has to be installed
Usage
import ezs from 'ezs';
import ezsBasics from 'ezs-basics';
ezs.use(ezsBasics);
process.stdin
.pipe(ezs('STATEMENT_NAME', { STATEMENT_PARAMETERS })
.pipe(process.stdout);Statements
Table of Contents
- BUFObject
- CSVObject
- CSVParse
- CSVString
- JSONParse
- JSONString
- OBJCount
- OBJFlatten
- OBJStandardize
- SKOSObject
- TXTConcat
- TXTObject
- TXTParse
- TXTZip
- URLFetch
- URLParse
- URLStream
- URLString
- XMLParse
- XMLString
BUFObject
Take Mixed and produce Buffer.
For example, it's useful to send string to browser.
Parameters
noneundefined
Returns Buffer
CSVObject
Take Array and transform rows into object.
Each row (Array) is tranformed
into a object where keys are the value of the first row
Parameters
noneundefined
Returns Object
CSVParse
Take String and parse CSV to generate object
Parameters
separatorString to indicate the CSV separator (optional, defaultauto)quoteString to indicate the CSV quote. (optional, defaultauto)
Returns Object
CSVString
Take Object and transform row into string
where each field is separated with a character
Parameters
formatString if set to "strict" the fields will wrapped with double quote (optional, defaultstandard)separatorString to indicate the CSV separator (optional, default;)headerBoolean first line contains key name (optional, defaulttrue)
Returns String
JSONParse
Take String and parse JSON and generate objects
Parameters
separatorString to split at every JSONPath found (optional, default*)
Returns Object
JSONString
Take Object and generate JSON
Parameters
wrapString every document are wrapped into an array (optional, defaulttrue)indentString indent JSON (optional, defaultfalse)
Returns String
OBJCount
Take Object and count how many objects are received and sent the total
Parameters
noneundefined
Returns Number
OBJFlatten
Take Object and flat it with delimited character.
Parameters
separatorString choose a character for flatten keys (optional, default/)safeBoolean preserve arrays and their contents, (optional, defaultfalse)
Returns Object
OBJStandardize
Take Object and standardize it so each object will have the sames keys
Parameters
noneundefined
Returns Object
SKOSObject
Take Object generated by XMLMapping & SKOS data and
create a new basic object with only keys & values
Parameters
noneundefined
Returns Object
TXTConcat
Take String and concat all items in just one string
Parameters
noneundefined
Returns String
TXTObject
Take String and generate an object with a key and a value, where the value is the input string.
Parameters
keyString choose a the key name (optional, defaultvalue)
Returns Object
TXTParse
Take String and split at each separator found
Parameters
separtorString choose character which trigger the split (optional, default\n)
Returns String
TXTZip
Take a String and zip it
Returns Buffer
URLFetch
Take Object and create a new field with the content of URL.
Or if no target will be specified, the output will be the content of URL
Parameters
urlString? URL to fecthtargetString? choose the key to setjsonString Pasre as JSON the content of URL (optional, defaultfalse)
Returns Object
URLParse
Take String of URL, parse it and returns Object
Returns Object
URLStream
Take Object as parameters of URL, throw each chunk from the result
Parameters
urlString? URL to fecthtargetString? choose the key to setjsonString Pasre as JSON the content of URL (optional, defaultfalse)
Returns Object
URLString
Take Object representing a URL and stringify it
Returns String
XMLParse
Take String as XML input, parse it and split it in multi document at each path found
Parameters
urlString? URL to fecthtargetString? choose the key to setseparatorString choose a character for flatten keys (optional, default/)
Returns Object
XMLString
Take Object and transform it into a XML string
Parameters
rootElementString Root element name for the tag which start and close the feed (optional, defaultitems)contentElementString Content element name for the tag which start and close each item (optional, defaultitem)
Returns String
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago