Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/published/stream-from-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const processFile = (
yield* fs.writeFileString(filePath, content);

// Create a stream from file content
const fileStream = Stream.fromEffect(fs.readFileString(filePath))
const fileStream = fs.stream(filePath)
.pipe(
// Split content into lines
Stream.map((content: string) => content.split('\n')),
Stream.map((content) => content.toString().split('\n')),
Stream.flatMap(Stream.fromIterable),
// Process each line
Stream.tap((line) => Effect.log(`Processing: ${line}`))
Expand Down
4 changes: 2 additions & 2 deletions content/src/stream-from-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const processFile = (
yield* fs.writeFileString(filePath, content);

// Create a stream from file content
const fileStream = Stream.fromEffect(fs.readFileString(filePath))
const fileStream = fs.stream(filePath)
.pipe(
// Split content into lines
Stream.map((content: string) => content.split('\n')),
Stream.map((content) => content.toString().split('\n')),
Stream.flatMap(Stream.fromIterable),
// Process each line
Stream.tap((line) => Effect.log(`Processing: ${line}`))
Expand Down
4 changes: 2 additions & 2 deletions rules/by-use-case/building-data-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ const processFile = (
yield* fs.writeFileString(filePath, content);

// Create a stream from file content
const fileStream = Stream.fromEffect(fs.readFileString(filePath))
const fileStream = fs.stream(filePath)
.pipe(
// Split content into lines
Stream.map((content: string) => content.split('\n')),
Stream.map((content) => content.toString().split('\n')),
Stream.flatMap(Stream.fromIterable),
// Process each line
Stream.tap((line) => Effect.log(`Processing: ${line}`))
Expand Down
4 changes: 2 additions & 2 deletions rules/intermediate.md
Original file line number Diff line number Diff line change
Expand Up @@ -1954,10 +1954,10 @@ const processFile = (
yield* fs.writeFileString(filePath, content);

// Create a stream from file content
const fileStream = Stream.fromEffect(fs.readFileString(filePath))
const fileStream = fs.stream(filePath)
.pipe(
// Split content into lines
Stream.map((content: string) => content.split('\n')),
Stream.map((content) => content.toString().split('\n')),
Stream.flatMap(Stream.fromIterable),
// Process each line
Stream.tap((line) => Effect.log(`Processing: ${line}`))
Expand Down
4 changes: 2 additions & 2 deletions rules/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -5325,10 +5325,10 @@ const processFile = (
yield* fs.writeFileString(filePath, content);

// Create a stream from file content
const fileStream = Stream.fromEffect(fs.readFileString(filePath))
const fileStream = fs.stream(filePath)
.pipe(
// Split content into lines
Stream.map((content: string) => content.split('\n')),
Stream.map((content) => content.toString().split('\n')),
Stream.flatMap(Stream.fromIterable),
// Process each line
Stream.tap((line) => Effect.log(`Processing: ${line}`))
Expand Down