0--0double

中文文档
1.1.0发布于 2020/02/26MITTypeScriptCommonJS零依赖

A package that initializes dd trace when the environment is production, (and is lexographically superior, so that it is sorted to be "first")

原始使用文档

A package that initializes dd trace when the environment is production, (and is lexographically superior, so that it is sorted to be "first").

Usage

To use this package, import or require it.

import '0-dd-trace-init-first-production';

Naming

  • 0- - beginning with a - is slightly prefered to me, but npmjs.com doesn't allow it. It just errors with a 404 if you try, so it might be a bug, but my gut says it's intentional. It's not consistent with the npm package though. Note that 0- is lexographically superior to 00000-. 0- is the most lexographically superior prefix for an npmjs.com package.
  • dd-trace - It's a dd-trace lib at heart, so it's got dd-trace in it.
  • init - It runs the init() method.
  • first - This is kind of redundant with the 0- prefix, but this should remind developers that it belongs at the first, in case someone decides to name their package 0--a or something silly that is more superior. I admit that this solution isn't perfect, it's just more perfect than anything else I can think of.
  • production - It only runs init() if the node env is production. Someone might want a 0-dd-trace-init-first that runs always or something.

版本与发布记录

0--0double 共发布 1 个版本,首次发布于 2020/02/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.1.0latest2020/02/266 年前

关于 0--0double 的常见问题

0--0double 是什么?

当环境是生产环境时初始化dd跟踪的包(并且在词法上是优先的,因此它被排序为“第一”)

如何安装 0--0double?

在项目目录运行 npm install 0--0double,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:dd-trace(>= 0.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

0--0double 支持 TypeScript 吗?

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

0--0double 支持 ESM 还是 CommonJS?

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

0--0double 可以商用吗?

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

0--0double 还在维护吗?

最新版本 1.1.0 发布于 2020/02/26(6 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/02/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。