nv-facutil-jdot-flat
v1.0.0
Published
nv-facutil-jdot-flat ======================= - simple version flat json
Readme
nv-facutil-jdot-flat
- simple version flat json
install
- npm install nv-facutil-jdot-flat
usage
const x = require("nv-facutil-jdot-flat");example
var d = {
"name": "nv-facutil-jdot-flat",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"datas": [1,2,3,4,5,6]
}
var d2 = x.flat(d);
/*
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
'scripts.test': 'echo "Error: no test specified" && exit 1',
author: '',
license: 'ISC',
'datas.0': 1,
'datas.1': 2,
'datas.2': 3,
'datas.3': 4,
'datas.4': 5,
'datas.5': 6
}
*/
x.nest(d2)
/*
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
author: '',
license: 'ISC',
datas: [ 1, 2, 3, 4, 5, 6 ]
}
*/
var kvl = x.to_kvl(d)
/*
{
kl: [
'name', 'version',
'description', 'main',
'scripts.test', 'author',
'license', 'datas.0',
'datas.1', 'datas.2',
'datas.3', 'datas.4',
'datas.5'
],
vl: [
'nv-facutil-jdot-flat',
'1.0.0',
'',
'index.js',
'echo "Error: no test specified" && exit 1',
'',
'ISC',
1,
2,
3,
4,
5,
6
]
}
>
*/
x.fr_kvl(kvl)
/*
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
author: '',
license: 'ISC',
datas: [ 1, 2, 3, 4, 5, 6 ]
}
*/
var pvl = x.to_pvl(d)
/*
{
pls: [
[ 'name' ],
[ 'version' ],
[ 'description' ],
[ 'main' ],
[ 'scripts', 'test' ],
[ 'author' ],
[ 'license' ],
[ 'datas', 0 ],
[ 'datas', 1 ],
[ 'datas', 2 ],
[ 'datas', 3 ],
[ 'datas', 4 ],
[ 'datas', 5 ]
],
vl: [
'nv-facutil-jdot-flat',
'1.0.0',
'',
'index.js',
'echo "Error: no test specified" && exit 1',
'',
'ISC',
1,
2,
3,
4,
5,
6
]
}
*/
x.fr_pvl(pvl)
/*
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
author: '',
license: 'ISC',
datas: [ 1, 2, 3, 4, 5, 6 ]
}
>
*/
x.creat_idxmp(d)
/*
{
name: 0,
version: 1,
description: 2,
main: 3,
scripts: { test: 4 },
author: 5,
license: 6,
datas: [ 7, 8, 9, 10, 11, 12 ]
}
*/
var tbl = x.creat_tbl(d)
/*
> tbl.json()
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
scripts: { test: 'echo "Error: no test specified" && exit 1' },
author: '',
license: 'ISC',
datas: [ 1, 2, 3, 4, 5, 6 ]
}
>
*/
/*
> tbl.flat_json()
{
name: 'nv-facutil-jdot-flat',
version: '1.0.0',
description: '',
main: 'index.js',
'scripts.test': 'echo "Error: no test specified" && exit 1',
author: '',
license: 'ISC',
'datas.0': 1,
'datas.1': 2,
'datas.2': 3,
'datas.3': 4,
'datas.4': 5,
'datas.5': 6
}
*/
/*
> tbl.pgjson()
{
c0: 'nv-facutil-jdot-flat',
c1: '1.0.0',
c2: '',
c3: 'index.js',
c4: 'echo "Error: no test specified" && exit 1',
c5: '',
c6: 'ISC',
c7: 1,
c8: 2,
c9: 3,
c10: 4,
c11: 5,
c12: 6
}
*/
/*
> tbl.idxmp_
{
name: 0,
version: 1,
description: 2,
main: 3,
scripts: { test: 4 },
author: 5,
license: 6,
datas: [ 7, 8, 9, 10, 11, 12 ]
}
>
*/
/*
> tbl.keys()
[
'name', 'version',
'description', 'main',
'scripts.test', 'author',
'license', 'datas.0',
'datas.1', 'datas.2',
'datas.3', 'datas.4',
'datas.5'
]
> tbl.values()
[
'nv-facutil-jdot-flat',
'1.0.0',
'',
'index.js',
'echo "Error: no test specified" && exit 1',
'',
'ISC',
1,
2,
3,
4,
5,
6
]
*/
/*
tbl.creat_updt_set_for_sql(
[(idxmp)=>idxmp.main, "sss"],
[(idxmp)=>idxmp.scripts.test,"SSSSSS"],
)
"SET c3 = 'sss',c4 = 'SSSSSS';"
*/
/*
tbl.creat_inst_vals_for_sql(
[(idxmp)=>idxmp.main, "sss"],
[(idxmp)=>idxmp.scripts.test,"SSSSSS"]
)
//"(c3,c4) VALUES ('sss','SSSSSS')"
*/
/*
> tbl.creat_slct_cols_for_sql(
(idxmp)=>idxmp.main,
(idxmp)=>idxmp.scripts.test
)
'c3,c4'
>
*/METHODS
APIS
LICENSE
- ISC
