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

@flaxia/sdk

v0.5.0

Published

Flaxia Crowd の**タスク依頼者向けSDK**。型定義は全パッケージ(worker・node)の単一の真実の源泉です。

Readme

@flaxia/sdk

Flaxia Crowd のタスク依頼者向けSDK。型定義は全パッケージ(worker・node)の単一の真実の源泉です。

インストール

npm install @flaxia/sdk

依存関係はゼロ(fetch のみ使用)。

使い方

import { FlaxiaClient } from '@flaxia/sdk'

const client = new FlaxiaClient({
  apiKey: 'fc_live_xxxxxxxxxxxx',
})

const task = await client.submit({
  workload: 'ai-inference',
  payload: {
    task: 'text-classification',
    model: 'Xenova/distilbert-base-uncased-finetuned-sst-2-english',
    input: 'This is amazing!',
  },
})

// 結果をポーリング
const result = await client.waitForTask(task.id)
console.log(result)

API

FlaxiaClient

| メソッド | 引数 | 戻り値 | 説明 | |---------|------|--------|------| | submit() | SubmitTaskOptions | Promise<TaskRecord> | タスクを投入し、即座に taskId を返す | | getTask() | taskId: string | Promise<TaskRecord> | タスクの状態を取得 | | waitForTask() | taskId, intervalMs?, timeoutMs? | Promise<TaskRecord> | 完了するまでポーリング(デフォルト: 2s間隔, 60sタイムアウト) |

対応ワークロード

| 型 | 説明 | |----|------| | ai-inference | HuggingFace Transformers.js によるAI推論 | | image-process | OffscreenCanvas を用いた画像処理(resize, grayscale, compress, thumbnail) | | file-convert | ファイル変換(Phase 2) | | container | container2wasm を用いたLinuxコンテナ実行 |

Error クラス

| クラス | HTTP Status | code | |--------|------------|------| | AuthenticationError | 401 | AUTH_ERROR | | TaskNotFoundError | 404 | TASK_NOT_FOUND | | ValidationError | 400 | VALIDATION_ERROR | | FlaxiaError | 可変 | 可変(基本クラス) |

型定義

@flaxia/sdk は以下の型を提供し、@flaxia/worker と @flaxia/node が参照します:

  • WorkloadType — workload 種別のユニオン型
  • AiInferencePayload / AiInferenceResult — AI推論のペイロード/結果
  • ImageProcessPayload / ImageProcessResult — 画像処理のペイロード/結果
  • ContainerPayload / ContainerResult — コンテナ実行のペイロード/結果
  • FileConvertPayload — ファイル変換のペイロード
  • TaskPayload — 全ペイロードのユニオン型
  • TaskRecord — 完全なタスクオブジェクト(状態・結果・エラー等)
  • NodeConfig — ノード設定(@flaxia/node が使用)

ランタイム契約

型だけでなく、worker / node / ホストで共有すべき実行時の契約も @flaxia/sdk が単一の真実の源泉として提供します。各パッケージでワークロード一覧や重み判定を再定義しないでください。

import {
  WORKLOAD_TYPES,          // プロトコル上の全ワークロード
  ROUTABLE_WORKLOADS,      // オーケストレーターが投入可能な実装済みワークロード
  HEAVY_WORKLOADS,         // 低メモリノードに割り当ててはいけない重い処理
  DEFAULT_WORKLOAD_TIMEOUT_MS,
  isWorkloadType,
  isRoutableWorkload,
  isHeavyWorkload,
  defaultTimeoutFor,
  parseCrowdWebhook,
  extractCallbackOutput,
  buildCallbackUrl,
  callbackTypeFromUrl,
  resolveNsfwTags,
} from '@flaxia/sdk'

| ヘルパー | 用途 | |---------|------| | WORKLOAD_TYPES / isWorkloadType | 信頼できない入力の検証 | | ROUTABLE_WORKLOADS / isRoutableWorkload | オーケストレーターの投入可否チェック | | HEAVY_WORKLOADS / isHeavyWorkload | 低メモリノードへのルーティング抑止 | | buildCallbackUrl / callbackTypeFromUrl | ホスト側 Webhook URL の生成・判別 | | parseCrowdWebhook / extractCallbackOutput | Webhook ボディの検証と結果抽出 | | resolveNsfwTags | NudeNet 検出結果からコンテンツタグへの変換 |

moe-inference はプロトコル型として宣言済みですが、ノード実装が無いため ROUTABLE_WORKLOADS には含まれません。swarm-inference は複数ノードでモデルのレイヤーを分割して1件の生成ジョブを処理するワークロードで、WebGPU と(NodeConfig.allowModelDownload による)モデル重みのダウンロード同意が前提です。