稳定性指数


在文档中都有章节稳定性的标志。 有些 API 已被证明和依赖,因此它们几乎不可能改变。 有些则是全新的和实验的、或者已知是危险的。

稳定性指数如下:

稳定性: 0 - 弃用。 该特性可能会触发警告。 不保证向后的兼容性。

稳定性: 1 - 实验。 该特性不受语义版本控制规范的约束。 在任何未来的版本中都可能发生非向后兼容的更改或删除。 不建议在生产环境中使用该特性。

Stability: 2 - 稳定。 与 npm 生态系统的兼容性是重中之重。

稳定性: 3 - 旧版。 尽管此特性不太可能被删除并且仍由语义版本控制保证覆盖, 但它不再被积极维护, 并且有其他替代方案可用。

如果特性的使用没有害处并且其在 npm 生态系统中被广泛依赖,则标记为旧版而不是弃用。 旧版特性中发现的缺陷不太可能被修复。

当使用实验的特性时要小心,尤其是在模块中。 用户可能不知道正在使用实验的特性。 当实验的 API 发生修改时,故障或行为的变化可能会让用户感到诧异。 为避免诧异,使用实验的特性可能需要命令行标志。 实验的特性也可能触发警告

Throughout the documentation are indications of a section's stability. Some APIs are so proven and so relied upon that they are unlikely to ever change at all. Others are brand new and experimental, or known to be hazardous.

The stability indices are as follows:

Stability: 0 - Deprecated. The feature may emit warnings. Backward compatibility is not guaranteed.

Stability: 1 - Experimental. The feature is not subject to semantic versioning rules. Non-backward compatible changes or removal may occur in any future release. Use of the feature is not recommended in production environments.

Stability: 2 - Stable. Compatibility with the npm ecosystem is a high priority.

Stability: 3 - Legacy. Although this feature is unlikely to be removed and is still covered by semantic versioning guarantees, it is no longer actively maintained, and other alternatives are available.

Features are marked as legacy rather than being deprecated if their use does no harm, and they are widely relied upon within the npm ecosystem. Bugs found in legacy features are unlikely to be fixed.

Use caution when making use of Experimental features, particularly within modules. Users may not be aware that experimental features are being used. Bugs or behavior changes may surprise users when Experimental API modifications occur. To avoid surprises, use of an Experimental feature may need a command-line flag. Experimental features may also emit a warning.