Skip to content

Commit 356797a

Browse files
authored
docs: fs already defined in example (#1)
Fixes non-compileable code example where we set both `node:fs` import and `unixfs(helia)` to a variable `fs`.
1 parent 9de4a05 commit 356797a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/car/src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* import { car } from '@helia/car'
1616
* import { CarWriter } from '@ipld/car'
1717
* import { Readable } from 'node:stream'
18-
* import fs from 'node:fs'
18+
* import nodeFs from 'node:fs'
1919
*
2020
* const helia = createHelia({
2121
* // ... helia config
@@ -30,7 +30,7 @@
3030
* const { writer, out } = await CarWriter.create(cid)
3131
*
3232
* // `out` needs to be directed somewhere, see the @ipld/car docs for more information
33-
* Readable.from(out).pipe(fs.createWriteStream('example.car'))
33+
* Readable.from(out).pipe(nodeFs.createWriteStream('example.car'))
3434
*
3535
* // write the DAG behind `cid` into the writer
3636
* await c.export(cid, writer)
@@ -44,14 +44,14 @@
4444
* import { car } from '@helia/car'
4545
* import { CarReader } from '@ipld/car'
4646
* import { Readable } from 'node:stream'
47-
* import fs from 'node:fs'
47+
* import nodeFs from 'node:fs'
4848
*
4949
* const helia = createHelia({
5050
* // ... helia config
5151
* })
5252
*
5353
* // import the car
54-
* const inStream = fs.createReadStream('example.car')
54+
* const inStream = nodeFs.createReadStream('example.car')
5555
* const reader = await CarReader.fromIterable(inStream)
5656
*
5757
* await c.import(reader)

0 commit comments

Comments
 (0)