npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cctailpipe

v1.0.4

Published

JSONLファイルをリアルタイムストリーム処理するサーバーアプリケーション

Downloads

9

Readme

cctailpipe

~/.claude/projects/ 配下のJSONLファイルをリアルタイムで監視し、ストリーム処理を行うClaude Code向けJSONLストリーム処理ツールです。

特徴

  • リアルタイム監視: JSONLファイルの変更を自動検知
  • プラグインシステム: フィルタリングと出力処理を拡張可能
  • TypeScript実装: 型安全な開発環境
  • 設定ファイル対応: JSON形式で柔軟な設定管理

インストール

npm経由でのインストール(推奨)

# グローバルインストール
npm install -g cctailpipe

# プロジェクトローカルインストール
npm install cctailpipe

開発用のローカルインストール

git clone https://github.com/lcnomoto/cctailpipe.git
cd cctailpipe
npm install

使用方法

npmパッケージとして使用する場合

# 基本的な起動
cctailpipe

# 設定ファイルを指定して起動
cctailpipe --config ./my-config.json
cctailpipe ./my-config.json

# ヘルプ表示
cctailpipe --help

開発環境での使用

# 基本的な起動
npm run dev

# 設定ファイルを指定して起動
npm run dev -- ./my-config.json

設定ファイル

設定ファイル例 (config.json):

{
  "watchDirectory": "/Users/username/.claude/projects",
  "plugins": {
    "filters": [
      {
        "name": "ErrorFilter",
        "module": "./dist/plugins/filters/KeywordFilterPlugin.js",
        "options": {
          "keywords": ["error", "warning"],
          "mode": "include",
          "caseSensitive": false
        }
      }
    ],
    "outputs": [
      {
        "name": "ConsoleOutput",
        "module": "./dist/plugins/outputs/ConsoleOutputPlugin.js",
        "options": {
          "format": "pretty",
          "timestamp": true
        }
      },
      {
        "name": "FileOutput",
        "module": "./dist/plugins/outputs/FileOutputPlugin.js",
        "options": {
          "outputPath": "./output/filtered.jsonl",
          "mode": "append"
        }
      }
    ]
  },
  "pipelines": [
    {
      "name": "ErrorPipeline",
      "filter": "ErrorFilter",
      "outputs": ["FileOutput"]
    }
  ],
  "globalFilters": [],
  "globalOutputs": [
    "ConsoleOutput"
  ],
  "options": {
    "debounceMs": 1000,
    "maxRetries": 3,
    "logLevel": "info"
  }
}

FieldMatchFilterPlugin の使用例

特定のフィールドの値で条件フィルタリングを行います:

{
  "name": "StatusFilter",
  "module": "./dist/plugins/filters/FieldMatchFilterPlugin.js",
  "options": {
    "field": "status",          // チェックするフィールド
    "value": "error",           // マッチさせる値
    "operator": "equals",       // 比較演算子
    "caseSensitive": false,     // 大文字小文字を区別しない
    "mode": "include"           // 一致したものを通す
  }
}

利用可能な演算子

  • equals: 完全一致
  • contains: 部分一致
  • startsWith: 前方一致
  • endsWith: 後方一致
  • gt: より大きい(数値)
  • gte: 以上(数値)
  • lt: より小さい(数値)
  • lte: 以下(数値)
  • regex: 正規表現マッチ

ネストしたフィールドの指定

{
  "field": "user.profile.age",
  "value": 18,
  "operator": "gte"
}

プラグイン開発

フィルタープラグイン

import { BaseFilterPlugin } from './BaseFilterPlugin.js';
import { JsonlRecord } from '../../types/index.js';

export class MyFilterPlugin extends BaseFilterPlugin {
  readonly name = 'MyFilter';
  
  filter(record: JsonlRecord): boolean {
    // フィルタリングロジックを実装
    return true; // trueで処理続行、falseで除外
  }
}

出力プラグイン

import { BaseOutputPlugin } from './BaseOutputPlugin.js';
import { JsonlRecord } from '../../types/index.js';

export class MyOutputPlugin extends BaseOutputPlugin {
  readonly name = 'MyOutput';
  
  async output(record: JsonlRecord): Promise<void> {
    // 出力処理を実装
    console.log(record);
  }
}

利用可能な組み込みプラグイン

フィルタープラグイン

  • KeywordFilterPlugin: キーワードベースのフィルタリング
  • FieldMatchFilterPlugin: フィールド値による条件フィルタリング

出力プラグイン

  • ConsoleOutputPlugin: コンソール出力
  • FileOutputPlugin: ファイル出力
  • HttpOutputPlugin: HTTP API出力
  • MarkdownOutputPlugin: Markdown形式でのファイル出力

開発コマンド

# 開発サーバー起動
npm run dev

# ビルド
npm run build

# 本番環境実行
npm start

# 型チェック
npm run type-check

# リント
npm run lint

アーキテクチャ

src/
├── core/              # コア機能
│   ├── FileWatcher.ts      # ファイル監視
│   ├── JsonlStreamProcessor.ts  # ストリーム処理
│   └── JsonlStreamServer.ts     # メインサーバー
├── plugins/           # プラグインシステム
│   ├── filters/           # フィルタープラグイン
│   └── outputs/           # 出力プラグイン
├── config/            # 設定管理
├── types/             # 型定義
└── index.ts           # エントリーポイント

ライセンス

MIT