@clinic/bubbleprof

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

Programmable interface to Clinic.js Bubbleprof

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

Clinic.js Bubbleprof

Greenkeeper badge npm version Stability Stable Github Actions build status Downloads Code style

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

Screenshot

Issues

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

Installation

npm i -S @clinic/bubbleprof

Supported node versions

  • Node.js 16 and above

Example

const ClinicBubbleprof = require('@clinic/bubbleprof')
const bubbleprof = new ClinicBubbleprof()

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

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

To get started with Clinic.js Bubbleprof you might want to take a look at the examples repo.

Documentation

const ClinicBubbleprof = require('@clinic/bubbleprof')
const bubbleprof = new ClinicBubbleprof()

new ClinicBubbleprof([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: '.'

bubbleprof.collect(args, callback)

Starts a process by using:

const { spawn } = require('child_process')
spawn(args[0], ['-r', 'sampler.js'].concat(args.slice(1)))

The injected sampler 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.

bubbleprof.visualize(dataFilename, outputFilename, callback)

Will consume the data file specified by dataFilename, this data file will be produced by the sampler using bubbleprof.collect.

bubbleprof.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/bubbleprof 共发布 5 个版本,首次发布于 2021/11/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
10.0.0latest2023/06/283 年前
9.1.02023/03/163 年前
9.0.02022/08/264 年前
8.0.12021/12/274 年前
8.0.02021/11/124 年前

关于 @clinic/bubbleprof 的常见问题

@clinic/bubbleprof 是什么?

Programmable interface to Clinic.js Bubbleprof

如何安装 @clinic/bubbleprof?

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

@clinic/bubbleprof 支持 TypeScript 吗?

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

@clinic/bubbleprof 可以商用吗?

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

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

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

@clinic/bubbleprof 还在维护吗?

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