nilobarp / text2json Goto Github PK
View Code? Open in Web Editor NEWPerformant parser for textual data (CSV parser)
License: MIT License
Performant parser for textual data (CSV parser)
License: MIT License
There is an empty line at the end
U+2B695 shī
U+2B699 pū
U+2B6DB zhī
U+2B6DE jué
U+2B6E2 níng
U+2B6F6 chì
U+2B6F8 tí
import fs from "fs";
import test from "ava";
import jsonfile from "jsonfile";
import dataminer from "../src/dataminer";
test("extractPronunciation()", t => {
const filepath = "src/codepoint-ruby.tsv";
const data = dataminer.convertToJson(filepath, { separator: " " });
t.is(data > 0);
});
import jsonfile from "jsonfile";
import text2json from "text2json";
export default {
convertToJson: (filepath, options) => {
const data = [];
const parse = new text2json.Parser({ ...options, hasHeader: true });
parse
.text2json(filepath)
.on("row", row => {
data.push(row);
})
.on("end", () => {
console.log("Done >>>>>");
return data;
});
},
};
I see not trace of the end
event being triggered, and the convertToJson()
return nothing so my test fail, am I missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.