Socket
Socket
Sign inDemoInstall

@perfsee/package

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@perfsee/package

package analyzer sdk by perfsee


Version published
Maintainers
5
Created
Source

@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.

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc