# @bsull/augurs 中文文档

规范地址：https://npmcn.com/package/%40bsull/augurs/

版本：0\.10\.3
npm 元数据更新时间：2026-10-27T12:57:27.668Z
中文译文更新时间：2026-11-08T17:21:49.904Z
软件包许可：MIT OR Apache-2\.0

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

原始 npm 页面：https://www.npmjs.com/package/%40bsull/augurs
原文对照：https://npmcn.com/package/%40bsull/augurs/?lang=original
项目主页：https://github.com/grafana/augurs#readme
源码仓库：https://github.com/grafana/augurs

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

- 包体积（解压后）：2.5 MB，42 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2023-09-28T21:12:24.591Z
- 最新版本发布：2026-10-27T12:57:26.210Z
- 近 30 天下载量：152307（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：36（近 12 个月 2 个）

## 中文简介

JavaScript 为时序库所绑定.

## 安装

```sh
npm install @bsull/augurs
```

也可以使用：`pnpm add @bsull/augurs`、`yarn add @bsull/augurs`、`bun add @bsull/augurs`

## README

# 预兆

[![npm](https://img.shields.io/npm/v/@bsull/augurs)](https://www.npmjs.com/package/@bsull/augurs) [![npm](https://img.shields.io/npm/dm/@bsull/augurs)](https://www.npmjs.com/package/@bsull/augurs) [![npm](https://img.shields.io/npm/l/@bsull/augurs)](https://www.npmjs.com/package/@bsull/augurs)

JavaScript 为时间序列框架提供约束.

## 安装

将此软件包添加到您的工程中 :

```bash
npm install @bsull/augurs
```

## 使用量

完全使用 docs 仍然要来, 但这里有一个简单的例子:

```js
import initProphet, { Prophet } from '@bsull/augurs/prophet';
import initTransforms, { Pipeline, Transform } from '@bsull/augurs/transforms';
// Note: you'll need this extra package if you want to use the Prophet model.
import { optimizer } from '@bsull/augurs-prophet-wasmstan';

// Initialize the WASM components before using any augurs functions.
await Promise.all([initProphet(), initTransforms()]);

// Create a pipeline which will apply a Yeo-Johnson transform and a standard scaler.
const pipeline = new Pipeline([
  new Transform('yeoJohnson'),
  new Transform('standardScaler'),
]);

// Create a Prophet model with the WASM-based optimizer.
const prophet = new Prophet({ optimizer });

const ds = [1704067200, 1704871384, 1705675569, 1706479753, 1707283938, 1708088123,
const y = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0];

// Fit the pipeline to the data.
const yTransformed = pipeline.fitTransform(y);

// Fit the Prophet model to the transformed data.
prophet.fit({ ds, y: yTransformed });

// Make in-sample predictions and back-transform them.
const preds = prophet.predict();
const yhat = {
  point: pipeline.inverseTransform(preds.yhat.point),
  intervals: {
    lower: pipeline.inverseTransform(preds.yhat.lower),
    upper: pipeline.inverseTransform(preds.yhat.upper),
  },
};
```

见 [文档](https://docs.augu.rs/js/getting-started/quick-start) 更多信息.

## 许可证

这个项目是双重许可的 [Apache 2.0 (英语)](https://npmcn.com/package/%40bsull/augurs/LICENSE-APACHE) 财务报告和审定财务报表 [麻省理工学院](https://npmcn.com/package/%40bsull/augurs/LICENSE-MIT) 执照.

## 常见问题

### @bsull/augurs 是什么？

JavaScript 为时序库所绑定\.

### 如何安装 @bsull/augurs？

在项目目录运行 npm install @bsull/augurs，或使用 pnpm add / yarn add / bun add。

### @bsull/augurs 支持 TypeScript 吗？

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

### @bsull/augurs 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @bsull/augurs 可以商用吗？

@bsull/augurs 使用 MIT OR Apache-2\.0 许可。可在 MIT、Apache-2\.0 中任选其一遵守。选择 MIT 时，宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @bsull/augurs 的下载量有多少？

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

### @bsull/augurs 还在维护吗？

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

