
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
data-to-json
Advanced tools
Reads a text file, CSV file or data variable having a table and returns an array of obects. In which each object consists of all headers as keys and there data as values.
Reads a text file, CSV file or data variable having a table and returns an array of obects. In which each object consists of all headers as keys and there data as values.
Can also filter data on given number of records and returns only required data in array.
npm i --save data-to-json
data-to-json
support CommonJS.
Use filePath
key to provide TEXT or CSV data from a file
.
const dataToJson = require("data-to-json");
Use .txt
to use TXT data.
const dataInJSON = dataToJson.txt({ filePath: "./filePath.txt" }).toJson();
OR
Use .csv
to use CSV data.
const dataInJSON = dataToJson.csv({ filePath: "./filePath.csv" }).toJson();
Use data
key to provide TEXT data from variable or directly
.
const dataInJSON = dataToJson.txt({ data: someTEXTData }).toJson();
OR
const dataInJSON = dataToJson.csv({ data: someCSVData }).toJson();
FIRST_NAME LAST_NAME NUMBER EMAIL ADDRESS
Debra Burks 880012XXXX debra.burks@yahoo.com 9273 Thome Ave., `Orchard Park`, NY - 14127
Kasha Todd null kasha.todd@yahoo.com 910, Vine Street!!!, (Campbell), CA - 95008
Tameka Fisher 880111XXXX null 7693 ~ Honey Creek St., Redondo Beach, "CA" 90278
FIRST_NAME,LAST_NAME,NUMBER,EMAIL,ADDRESS
Debra,Burks,880012XXXX,debra.burks@yahoo.com,"9273 Thome Ave., `Orchard Park`, NY - 14127"
Kasha,Todd,null,kasha.todd@yahoo.com,"910, Vine Street!!!, (Campbell), CA - 95008"
Tameka,Fisher,8800111XXX,null,"7693 ~ Honey Creek St., Redondo Beach, "CA" 90278"
[
{
FIRST_NAME: 'Debra',
LAST_NAME: 'Burks',
NUMBER: '880012XXXX',
EMAIL: 'debra.burks@yahoo.com',
ADDRESS: '9273 Thome Ave., `Orchard Park`, NY - 14127'
},
{
FIRST_NAME: 'Kasha',
LAST_NAME: 'Todd',
NUMBER: null,
EMAIL: 'kasha.todd@yahoo.com',
ADDRESS: '910, Vine Street!!!, (Campbell), CA - 95008'
},
{
FIRST_NAME: 'Tameka',
LAST_NAME: 'Fisher',
NUMBER: '880111XXXX',
EMAIL: null,
ADDRESS: '7693 ~ Honey Creek St., Redondo Beach, "CA" 90278'
}
]
Use .records
to get required number of rows.
const dataInJSON = dataToJson.txt({ filePath: "./filePath.txt" }).records(1).toJson();
OR
const dataInJSON = dataToJson.csv({ filePath: "./filePath.csv" }).records(1).toJson();
.records
is 1
(json data) :[
{
FIRST_NAME: 'Debra',
LAST_NAME: 'Burks',
NUMBER: '880012XXXX',
EMAIL: 'debra.burks@yahoo.com',
ADDRESS: '9273 Thome Ave., `Orchard Park`, NY - 14127'
}
]
FAQs
Reads a text file, CSV file or data variable having a table and returns an array of obects. In which each object consists of all headers as keys and there data as values.
The npm package data-to-json receives a total of 24 weekly downloads. As such, data-to-json popularity was classified as not popular.
We found that data-to-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
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.