Skip to content

Commit 9c98212

Browse files
committed
docs: add node22.mjs example
1 parent f3df598 commit 9c98212

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/node22.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
4+
import csv from '../index.js'
5+
6+
async function readCSV (file) {
7+
return Array.fromAsync(fs.createReadStream(file).pipe(csv()))
8+
}
9+
10+
const results = await readCSV(path.join(import.meta.dirname, '../test/fixtures/basic.csv'))
11+
12+
console.log(results)

0 commit comments

Comments
 (0)