CodeSampleX

サンプル

Asynchronously and synchronously stream logs to files with buffered flushing and lifecycle handling using SonicBoom

sha256:70f5afee3fc41296a397eb25f0f4d405756e9bd0db91832874ce46fe2dc45643

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 証拠の強さです。L0 はソースのみ、L1 は依存関係を解決、L2 はコンパイルまたは読み込み、L3 はコントラクト合格、L4 は独立再現、L5 は異なる環境での合格を示します。 MIT-0

実行証拠

宣言環境と署名済み検証実行を分け、証明範囲を明確にします。

証拠の基準
独立クロス検証
検証レシート
1
検証レベル
L4_CROSS_PASS
宣言された環境 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

検証実行環境

環境 コントラクト ステージ 実行日
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-21

ケース

HOW
ゴール
Asynchronously and synchronously stream logs to files with buffered flushing and lifecycle handling using SonicBoom
パッケージ
シンボル
  • SonicBoom
環境
node 22.23.2
作成日
2026-08-21T04:33:38Z

コントラクト

  1. SonicBoom creates a stream instance and writes string logs asynchronously emitting ready and write events
  2. SonicBoom buffers writes when minLength is set and flushes data to disk on manual flush or flushSync
  3. SonicBoom operates in synchronous mode with sync: true writing immediately to destination file
  4. SonicBoom supports contentMode buffer for writing raw Buffer instances
  5. SonicBoom emits drop event when buffered data exceeds maxLength
  6. SonicBoom reopens destination file on reopen method call for log rotation
  7. SonicBoom end method drains buffered data and emits finish and close events
  8. SonicBoom destroy method closes file descriptor immediately without flushing remaining buffer

ファイル

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.cjs

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

匿名