@perfsee/package
TypeScript icon, indicating that this package has built-in type declarations

1.13.0 • Public • Published

@perfsee/package

Repo | Docs

Perfsee SDK to analyze packages and upload results to perfsee platform.

Usage

Analyze package and upload to platform

If there are benchmark files described below which named xxx.bench.{js,ts}(by default), this command will run benchmarks before uploading.

PERFSEE_TOKEN=<your-token> npx @perfsee/package <path-to-package> --project=<perfsee-project-id>

Environment PERFSEE_TOKEN and option project are necessary.

Create benchmark file

Create a file named test.bench.js under the project.

const Benchmark = require('@perfsee/package')

Benchmark('foo', () => {
  bar()
})

Benchmark('bar', [
  {
    test: () => {
      baz()
    },
    options: { name: 'baz' },
  },
  {
    test: async () => {
      await setup()
      return () => {
        quz()
      }
    },
    options: { name: 'quz with async setup' },
  },
])

All benchmark files will be run during the analysis phase (if target is not browser).

CLI Options

project

Id of your perfsee project on the platform.

target: 'browser' | 'node'

default: 'node'

If target is browser, benchmarks will be bundled and run in headless chrome on server.

benchmarkPattern

default: '*.{bench|benchmark}.{js|ts}'

Glob pattern to find benchmark files.

Readme

Keywords

none

Package Sidebar

Install

npm i @perfsee/package

Weekly Downloads

2

Version

1.13.0

License

Apache-2.0

Unpacked Size

1.16 MB

Total Files

76

Last publish

Collaborators

  • domonji
  • eyhn
  • bytednpm
  • forehalo
  • jianling