LinusU / LinusU/node-jsonlines
Adding fileStream information to documentation
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 25
- フォーク
- 2
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
It might be helpful to include some documentation for people who are unfamiliar with transfer streams (like I was until I asked chatGPT). The docs mention that the stringifier writes to a transfer stream, but this is a subtle, and many people are likely to miss that detail or read through it because they don't know what it means.
Here is the code I wrote that can handle file streams:
import jsonlines from "jsonlines"
import fs from "fs"
import path from 'path'
export default function example () {
// I created a folder in my repo caled "files", and the stringifier will write to it (only locally, don't try this on something like Heroku)
const outputFilePath = path.join('files', 'jsonl-testing.jsonl')
const fileStream = fs.createWriteStream(outputFilePath)
const stringifier = jsonlines.stringify()
stringifier.pipe(fileStream)
stringifier.write({
"prompt": "Question: What is the meaning of life?\n\n###\n\n",
"completion": "Answer: 42.\n\nEND"
})
stringifier.write({
"prompt": "Question: What is not the meaning of life?\n\n###\n\n",
"completion": "Answer: not 42.\n\nEND"
})
stringifier.end()
fileStream.end() // do we need to do this? Docs do not specifiy
}
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
stringifier と転送ストリームについて説明しているドキュメントを見つけ、issue の file-stream の例と比較してください。読者が fs.createWriteStream へのパイピング方法と fileStream.end() が必要かどうかを理解できるようにドキュメントを更新してください。file-stream のワークフローとストリームを閉じる際の動作が明確になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100