@fnndsc/cumin

中文文档
3.30.6发布于 2026/11/15MITTypeScriptESM + CJS近 30 天下载 7703

Utility library for ChILI and other ChRIS-related JavaScript applications

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. Abstract
  4. Role in the Ecosystem
  5. Core Features
  6. Developer Setup
  7. License
  ____                _
 / ___|   _ ___  ____(_)_ __
| |  | | | | '_ \| '_ \| '_ \
| |__| |_| | | | | | | | | | |
 \____\__,_|_| |_|_| |_|_| |_|

Cumin Underpins Management Infrastructure Needs

cumin is the infrastructure and state management layer of the ChRIS interface ecosystem. It is a backend library that handles the "dirty work" of connecting to ChRIS, managing authentication tokens, and persisting user sessions.

Installation

npm install @fnndsc/cumin

Requires Node.js ≥ 20.12. Ships with TypeScript type definitions.

Usage

import { ChRISConnection, ChrisContext, ChrisIO } from "@fnndsc/cumin";

// The context engine remembers the active user, CUBE URL, and working directory
const context = new ChrisContext();
await context.init();
const cubeURL: string | null = await context.ChRISURL_get();

See Core Features for the full API surface.

Abstract

cumin abstracts the ChRIS REST API into a stateful, object-oriented environment. It is responsible for:

  1. Connection Management: Handling authentication, token storage, and client initialization.
  2. Context Persistence: Implementing the "Context" engine that remembers the active User, CUBE URL, and Working Directory.
  3. IO & Storage: Providing an abstraction (IStorageProvider) for filesystem access, enabling support for both Node.js (via fs) and other environments.

Role in the Ecosystem

In the "Sandwich Model" architecture, cumin is the bottom layer (just above the raw API client).

  • Consumers: Primarily salsa (logic) and chili (CLI state).
  • Environment: Designed for Node.js but architected with interfaces to support browser environments.

Core Features

  • ChrisContext: The state machine for multi-tenant, multi-backend sessions.
  • ChRISConnection: Wrapper for the low-level API client.
  • IStorageProvider: Abstraction interface for reading/writing config and data.
    • Includes readBinary for binary file uploads.
    • Includes recursive directory traversal helpers.
  • ChrisIO: High-level IO operations, including recursive directory uploading (uploadLocalPath).
  • ChRISResource.resources_getAll(): Generic pagination handler.
  • ListCache (listCache_get()): Session-scoped directory listing cache for the VFS.
  • ProcCache (procCache_get()): Session-scoped job monitoring DAG with versioned, identity-scoped daemon checkpoints. Restored topology remains usable while CUBE reconciliation runs; terminal status persists and active status refreshes on read. Powers the /proc/jobs/ VFS provider in salsa.

Developer Setup

To build the cumin library from source:

  1. Install dependencies:

    npm install
    
  2. Compile:

    npm run build
    

License

MIT — part of the ChRIS Project.


-30-

版本与发布记录

@fnndsc/cumin 共发布 78 个版本,首次发布于 2026/06/20;过去 12 个月发布了 78 个版本。

版本发布日期距今
3.30.6latest2026/11/15今天
3.30.52026/11/141 天前
3.30.42026/11/141 天前
3.30.32026/11/105 天前
3.30.22026/11/087 天前
3.30.12026/11/088 天前

关于 @fnndsc/cumin 的常见问题

@fnndsc/cumin 是什么?

Utility library for ChILI and other ChRIS-related JavaScript applications

如何安装 @fnndsc/cumin?

在项目目录运行 npm install @fnndsc/cumin,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cumin,可以用 npx cumin 直接运行。

@fnndsc/cumin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fnndsc/cumin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fnndsc/cumin 可以商用吗?

@fnndsc/cumin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fnndsc/cumin 的下载量有多少?

根据 npm 官方下载统计,@fnndsc/cumin 在 2026/10/15 – 2026/11/13 这 30 天内被下载 7,703 次,日均约 257 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fnndsc/cumin 还在维护吗?

最新版本 3.30.6 发布于 2026/11/15(今天);至今共发布 78 个版本,其中过去 12 个月发布了 78 个;首次发布于 2026/06/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。