Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Converts tabular row data (as from SQL joins, flat JSON, etc) to deep tree graphs based on simple column naming conventions.
Converts row data (in JSON/associative array format) to object/tree structure based on column naming conventions.
npm install --save treeize
treeize.grow(flatData, options)
- takes your results/rows of flat associative data and returns a full object graph.treeize.set(options)
- sets global options for the lib. For example, to use a path delimiter of '>' instead of '+', call treeize.set({ delimiter: '>' })
id
suggests an id
attribute on a root element, whereas name+first
implies a first
attribute on a name
object within a root element.+
delimiter (default) to seperate path nodes. To change this, use the treeize.set([options])
function.This library has several assumptions that make it possible.
var treeize = require('treeize');
var flatData = [
{
"name": "Mittens",
"age": 12,
"toys+name": "mouse",
"toys+owner+name": "Mittens"
},
{
"name": "Mittens",
"age": 12,
"toys+name": "yarn",
"toys+owner+name": "Ms. Threadz"
},
{
"name": "Tiger",
"age": 7,
"toys+name": "a stick",
"toys+owner+name": "Mother Nature"
}
];
var converted = treeize.grow(flatData);
[
{
"name": "Mittens",
"age": 12,
"toys": [
{
"name": "mouse",
"owner": {
"name": "Mittens"
}
},
{
"name": "yarn",
"owner": {
"name": "Ms. Threadz"
}
}
]
},
{
"name": "Tiger",
"age": 7,
"toys": [
{
"name": "a stick",
"owner": {
"name": "Mother Nature"
}
}
]
}
]
FAQs
Converts tabular row data (as from SQL joins, flat JSON, etc) to deep object graphs based on simple column naming conventions - without the use of an ORM or models.
We found that treeize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.