
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
csv-to-deep-json
Advanced tools
Transforms csv-string to 'deep' js object structure.
// if you have an array of comma-separated-strings you can just pass that array
export function buildObjectsFromCsv(csvStringArray: string[]): any[]
// if you have all data in single string (f.e. if you read it from a file)
// you can pass that single string and specify delimiter, and lib split that string for you
export function buildObjectsFromCsvString(csv: string, delimiter: string): any[];
name | dob.year NUMBER | dob.month NUMBER | dob.days NUMBER | friends [,] | isAlive BOOLEAN | moneyHave STRING |
---|---|---|---|---|---|---|
Ivan | 1993 | 1 | 3 | Kolya,Marina | TRUE | 200 USD |
Piter | 1857 | 5 | 26 | FALSE | 0 USD | |
Kolya | 2004 | 11 | 7 | Ivan,Marina | TRUE | 1000 UAH |
xlsx
library:name,dob.year NUMBER,dob.month NUMBER,dob.days NUMBER,"friends [,]",isAlive BOOLEAN,moneyHave STRING\nIvan,1993,1,3,"Kolya,Marina",TRUE,200 USD\nPiter,1857,5,26,,FALSE,0 USD\nKolya,2004,11,7,"Ivan,Marina",TRUE,1000 UAH
\n
:name,dob.year NUMBER,dob.month NUMBER,dob.days NUMBER,"friends [,]",isAlive BOOLEAN,moneyHave STRING
Ivan,1993,1,3,"Kolya,Marina",TRUE,200 USD
Piter,1857,5,26,,FALSE,0 USD
Kolya,2004,11,7,"Ivan,Marina",TRUE,1000 UAH
const csvStrings: string[] = [...];
const csv_to_json = require("csv-to-deep-json");
const data: any[] = csv_to_json.buildObjectsFromCsv(csvStrings);
console.log(JSON.stringify(data));
[
{
"name": "Ivan",
"dob": {
"year": 1993,
"month": 1,
"days": 3
},
"friends": [
"Kolya",
"Marina"
],
"isAlive": true,
"moneyHave": "200 USD"
},
{
"name": "Piter",
"dob": {
"year": 1857,
"month": 5,
"days": 26
},
"friends": null,
"isAlive": false,
"moneyHave": "0 USD"
},
{
"name": "Kolya",
"dob": {
"year": 2004,
"month": 11,
"days": 7
},
"friends": [
"Ivan",
"Marina"
],
"isAlive": true,
"moneyHave": "1000 UAH"
}
]
FAQs
CSV to deep json libarary
The npm package csv-to-deep-json receives a total of 35 weekly downloads. As such, csv-to-deep-json popularity was classified as not popular.
We found that csv-to-deep-json 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
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.