Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adakrei/stats

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adakrei/stats

JS/TS Performance Monitor

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
0
Weekly downloads
 
Created
Source

Stats-JS

NPM
JS/TS Performance Monitor

Installation

pnpm i @adakrei/stats

Demo

Basic
Custom
Stress

Usage

Here is a simple example to use Stats-JS

UMD
<script src="../dist/stats.min.js"></script>
<script>
let stats = new statsjs.Stats();
stats.showPanel(1);
document.body.appendChild(stats.dom);

let canvas = document.createElement('canvas');
canvas.width = 512;
canvas.height = 512;
document.body.appendChild(canvas);

let context = canvas.getContext('2d');
context.fillStyle = 'rgba(127,0,255,0.05)';

function animate() {
    let time = performance.now() / 1000;
    context.clearRect(0, 0, 512, 512);
    stats.begin();
    for (let i = 0; i < 2000; i++) {
        let x = Math.cos(time + i * 0.01) * 196 + 256;
        let y = Math.sin(time + i * 0.01234) * 196 + 256;

        context.beginPath();
        context.arc(x, y, 10, 0, Math.PI * 2, true);
        context.fill();
    }
    stats.end();
    requestAnimationFrame(animate);
}

animate();
</script>
ES Module
import { Stats } from '@adakrei/stats';

let stats = new Stats();
stats.showPanel(1);
//...

Keywords

FAQs

Package last updated on 02 Nov 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