mafintosh / mafintosh/csv-parser
process exits on apple silicon
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Description
* Operating System: macOS Big Sur 11.6
* Node Version: 14.17.6
* NPM Version: 7.12.0 - 1.22.15 (yarn)
* csv-parser Version: ^3.0.0
### Expected Behavior
to parse the csv (tsv in this case)
### Actual Behavior
exits process. seems like with code 0
### How Do We Reproduce?
download a bitcoin utxo day of data from the bottom of this page: https://gz.blockchair.com/bitcoin/outputs/ and try to unzip it. i am mapping the keys to camel cased, and converting values to useful ones such as numbers, dates, etc (separator is "\t")
specifically, i am using neat-csv to parse,
```
import * as fs from 'fs'
import BigNumber from 'bignumber.js'
export interface BlockchairOutput {
blockId: number;
transactionHash: string;
index: number;
time: Date;
value: BigNumber;
valueUsd: BigNumber;
recipient: string;
type: string;
scriptHex: string;
isFromCoinbase: boolean;
isSpendable: number;
}
const file = fs.createReadStream(filepath)
.pipe(
zlib.createGunzip()
)
const data = await neatCsv(file as unknown as fs.ReadStream, {
separator: '\t',
mapHeaders: ({ header }) => _.camelCase(header),
mapValues: ({ header, value }) => {
switch(header) {
case 'blockId':
return +value
case 'index':
return +value
case 'value':
return new BigNumber(value)
case 'time':
return new Date(value + 'Z')
case 'valueUsd':
return new BigNumber(value)
case 'isFromCoinbase':
return +value === 1
default:
return value
}
}
})
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the downloaded Bitcoin outputs archive, the supplied fs.createReadStream and zlib.createGunzip pipeline, and the neat-csv options using a tab separator. Compare the process behavior with the expected parsed output; done means the TSV completes parsing instead of exiting silently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, macos, node.js, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100