diff --git a/content/published/stream-from-file.mdx b/content/published/stream-from-file.mdx index 89d10c4..46c7b55 100644 --- a/content/published/stream-from-file.mdx +++ b/content/published/stream-from-file.mdx @@ -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}`)) diff --git a/content/src/stream-from-file.ts b/content/src/stream-from-file.ts index f939636..5d01c34 100644 --- a/content/src/stream-from-file.ts +++ b/content/src/stream-from-file.ts @@ -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}`)) diff --git a/rules/by-use-case/building-data-pipelines.md b/rules/by-use-case/building-data-pipelines.md index e07233b..7248383 100644 --- a/rules/by-use-case/building-data-pipelines.md +++ b/rules/by-use-case/building-data-pipelines.md @@ -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}`)) diff --git a/rules/intermediate.md b/rules/intermediate.md index 28fd483..bc53334 100644 --- a/rules/intermediate.md +++ b/rules/intermediate.md @@ -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}`)) diff --git a/rules/rules.md b/rules/rules.md index f9e9338..3e284a2 100644 --- a/rules/rules.md +++ b/rules/rules.md @@ -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}`))