# @dagster-io/dagster-pipes 中文文档

规范地址：https://npmcn.com/package/%40dagster-io/dagster-pipes/

版本：0\.1\.0
npm 元数据更新时间：2025-02-20T19:55:01.829Z
中文译文更新时间：2026-11-11T08:49:34.617Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40dagster-io/dagster-pipes
原文对照：https://npmcn.com/package/%40dagster-io/dagster-pipes/?lang=original

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：115 kB，21 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2025-02-20T19:55:01.189Z
- 最新版本发布：2025-02-20T19:55:01.462Z
- 近 30 天下载量：3417（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：1（近 12 个月 0 个）

## 中文简介

管道协议的打字符执行,与 [https://github.com/dagster-io/dagster 页面存档备份,存于互联网档案馆](https://github.com/dagster-io/dagster)

## 安装

```sh
npm install @dagster-io/dagster-pipes
```

也可以使用：`pnpm add @dagster-io/dagster-pipes`、`yarn add @dagster-io/dagster-pipes`、`bun add @dagster-io/dagster-pipes`

## README

# dagster-pipe-typescript

排字程序语言的管道执行 .

允许任何打字程序与 Dagster 管弦乐器之间的融合 .

## 使用量

### 先决条件

-   [安装节点和 npm](https://nodejs.org/en/download)
-   安装打字机编译器( e)`npm install -g typescript`(中文(简体) )

### 安装

`@dagster-io/dagster-pipes` 作为 npm 软件包可用 :

```sh
npm install @dagster-io/dagster-pipes
```

### 示例

> 除了下面的例子之外,您还可以找到一个带有打字管道资产的示例 `example-project/` 目录.

安装后 `@dagster-io/dagster-pipes` npm 软件包, 您的打字程序可以导入它与 dagster 集成 .

```typescript
import * as dagster_pipes from '@dagster-io/dagster-pipes';

using context = dagster_pipes.openDagsterPipes()

context.logger.info("this is a log message from the external process")
context.logger.warning("This is an example warning from the external process")

context.reportAssetMaterialization(
    {
        "row_count": 100
    }
)
context.reportAssetCheck(
    "example_typescript_check", true
)
```

在达克斯特管弦乐法中,增加以下内容:

```python
import subprocess
from pathlib import Path
import dagster as dg

@dg.asset(
    check_specs=[
        dg.AssetCheckSpec(
            name="example_typescript_check",
            asset="example_typescript_asset"
        )
    ]
)
def example_typescript_asset(
    context: dg.AssetExecutionContext, 
    pipes_subprocess_client: dg.PipesSubprocessClient
) -> dg.MaterializeResult:
    external_script_path = dg.file_relative_path(__file__, "../external_typescript_code/")
    
    subprocess.run(["npm install"],
                    cwd=external_script_path).check_returncode()
    subprocess.run(["tsc"],
                   cwd=external_script_path).check_returncode()

    return pipes_subprocess_client.run(
        command=["node", Path(external_script_path)],
        context=context,
    ).get_materialize_result()


defs = dg.Definitions(
    assets=[example_typescript_asset],
    resources={
        "pipes_subprocess_client": dg.PipesSubprocessClient()
    },
)

```

## 发展

### 正在编译开发版本

```
npm install && npm run build
```

### 测试

```
npm test
uv run --all-extras pytest
```

### 线性

```
npm run lint
```

## 常见问题

### @dagster-io/dagster-pipes 是什么？

管道协议的打字符执行,与 https://github\.com/dagster-io/dagster 页面存档备份,存于互联网档案馆

### 如何安装 @dagster-io/dagster-pipes？

在项目目录运行 npm install @dagster-io/dagster-pipes，或使用 pnpm add / yarn add / bun add。

### @dagster-io/dagster-pipes 支持 TypeScript 吗？

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

### @dagster-io/dagster-pipes 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @dagster-io/dagster-pipes 可以商用吗？

@dagster-io/dagster-pipes 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @dagster-io/dagster-pipes 的下载量有多少？

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

### @dagster-io/dagster-pipes 还在维护吗？

最新版本 0\.1\.0 发布于 2025/02/21（1\.7 年前）；至今共发布 1 个版本，其中过去 12 个月发布了 0 个；首次发布于 2025/02/21。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

