Comments (3)
Actually, looking at the code, it seems that streaming mode is not going to work since it calls the functions in app.js for every chunk and those functions output a complete array.
from csvjson.
I am also experiencing this issue. @pradeep-mishra please remove support for streaming data since it's clear that this is not supported at this time.
from csvjson.
bumped into this as well with not so big csv files ... (8914 lines / 760K) - think I solved it by piping through the following Transform
before toObject
. Anyway will be great to solve this correctly ...
const { Transform } = require('stream')
function friendlyChunks() {
const queue = []
return new Transform({
transform(chunk, encoding, callback) {
if (queue.length) {
chunk = Buffer.concat([queue.pop(), chunk])
}
let offset = chunk.length
for (let i = offset, found = false;
(!found && i);
i -= 1) {
if (chunk[i] === 10
|| chunk[i] === 13) {
found = true
offset = i
}
}
queue.push(Buffer.from(chunk.slice(offset + 1, chunk.length)))
this.push(chunk.slice(0, offset))
callback()
},
})
}
read.pipe(FriendlyChunks()).pipe(toObject).pipe(stringify).pipe(write)
from csvjson.
Related Issues (20)
- Comma inside String error HOT 2
- Double quotes in CSV cause error HOT 1
- 'ACL.read.allow.user': 'all', it is not coverting to objects , HOT 1
- TypeError: Cannot read property 'trim' of undefined HOT 2
- Add documentation HOT 1
- Wrong parsing if comma is in cells as well HOT 1
- Partial Header if '-' in key when converting JSON > CSV HOT 1
- Comma missing after the 'delimter' attribute ends in example HOT 1
- What if the input is in the form of string instead of stream? HOT 1
- Line Breaks break Parser HOT 2
- When a string value contains a comma, it gets split into two values HOT 2
- Error while compiling in an Angular application HOT 4
- It is separating cell even a cell has comma inside it
- Add type declaration for typescript
- Double quotes in CSV cause error HOT 2
- How to disable quotes for bool value?
- Filter exported fields
- Not able to change objectDenote and arrayDenote to empty strings.
- Module not found: Error: Can't resolve 'stream' in .../node_modules/csvjson/src'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csvjson.