@lskjs/stats

LSK.js – stats – Module for count simple statistics

Usage no npm install needed!

<script type="module">
  import lskjsStats from 'https://cdn.skypack.dev/@lskjs/stats';
</script>

README

LSK.js – stats

@lskjs/stats – LSK.js – stats – Module for count simple statistics

LSK logo NPM version NPM downloads NPM Dependency count Have TypeScript types Have tree shaking NPM Package size Package size Ask us in Telegram


Table of contents

⌨️ Install

# yarn
yarn i @lskjs/stats 

# npm
npm i @lskjs/stats 

Example:

import ready from './polyfill';
import Stats from './Stats';

ready();

const stats = new Stats();
const startedAt = new Date();

setInterval(() => {
  const event = Math.random() < 0.3 ? 'nack' : 'ack';
  const proxy = Math.random() < 0.3 ? 'none' : `proxy_${Math.round((Math.random() * 10) % 10)}`;

  let err;
  if (event === 'nack') {
    err = `code_${Math.round((Math.random() * 10) % 10)}`;
  }
  stats.trigger({ event, startedAt, err, proxy });
  // stats.trigger({ event, startedAt, err, prefix: proxy });
  stats.print();
}, 10);

📖 License

This project is licensed under the MIT License - see the LICENSE file for details

👥 Contributors


Igor Suvorov

💻 🎨 🤔

👏 Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b features/fooBar)
  3. Commit your changes (git commit -am 'feat(image): Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

📮 Any questions? Always welcome :)