@clinic/flame

中文文档
13.0.0发布于 2023/06/28MITCommonJS近 30 天下载 16.9万

Programmable interface to Clinic.js Flame

原始使用文档
文档目录7 节
  1. Issues
  2. Installation
  3. Supported node versions
  4. Example
  5. Documentation
  6. new ClinicFlame([settings])
  7. License

Clinic.js Flame

npm version Stability Stable Github Actions build status Downloads Code style

Programmable interface to Clinic.js Flame. Learn more about Clinic.js: https://clinicjs.org/

Screenshot

Issues

To open an issue, please use the main repository with the flame label.

Installation

npm i -S @clinic/flame

Supported node versions

  • Node.js 16 and above

Example

const ClinicFlame = require('@clinic/flame')
const flame = new ClinicFlame()

flame.collect(['node', './path-to-script.js'], function (err, filepath) {
  if (err) throw err

  flame.visualize(filepath, filepath + '.html', function (err) {
    if (err) throw err
  })
})

Documentation

const ClinicFlame = require('@clinic/flame')
const flame = new ClinicFlame()

new ClinicFlame([settings])

  • settings <Object>
    • detectPort <boolean> Default: false
    • debug <boolean> If set to true, the generated html will not be minified. Default: false
    • dest <String> The folder where the collected data is stored. Default: '.'
    • kernelTracing <boolean> If set to true, it will use linux_perf to profile the application. (available only on linux) Default: false

flame.collect(args, callback)

Starts a process by using 0x

0x will produce a file in the current working directory, with the process PID in its filename. The filepath relative to the current working directory will be the value in the callback.

stdout, stderr, and stdin will be relayed to the calling process. As will the SIGINT event.

flame.visualize(dataFilename, outputFilename, callback)

Will consume the datafile specified by dataFilename, this datafile will be produced by the sampler using flame.collect.

flame.visualize will then output a standalone HTML file to outputFilename. When completed the callback will be called with no extra arguments, except a possible error.

License

MIT

版本与发布记录

@clinic/flame 共发布 9 个版本,首次发布于 2021/11/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
13.0.0latest2023/06/283 年前
12.1.12023/04/033 年前
12.1.02023/03/163 年前
12.0.02022/08/244 年前
11.0.32022/03/224 年前
11.0.22022/03/104 年前

关于 @clinic/flame 的常见问题

@clinic/flame 是什么?

Programmable interface to Clinic.js Flame

如何安装 @clinic/flame?

在项目目录运行 npm install @clinic/flame,或使用 pnpm add / yarn add / bun add。

@clinic/flame 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/clinic__flame 是否存在。

@clinic/flame 支持 ESM 还是 CommonJS?

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

@clinic/flame 可以商用吗?

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

@clinic/flame 的下载量有多少?

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

@clinic/flame 还在维护吗?

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