Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.42 KB

README.md

File metadata and controls

33 lines (24 loc) · 1.42 KB

Santi's Advanced Averaging Library

Build Status npm homepage GitHub stars License Bundlephobia stats

  • 📘 Comes with built-in TypeScript definitions
  • 🚀 Lightweight and fast
  • 👴 Compliant with ECMAScript 3

API

  • function average(array: number[]): number; Finds the average of an array of numbers.

    Name Type Description Optional?
    array number[] The array whose average is to be calculated. No

Usage

import average = require('@santi100/average-lib'); // TypeScript
import average from '@santi100/average-lib'; // ESM
const average = require('@santi100/average-lib'); // CJS

// Example usage of the average function
const numbers: number[] = [1, 2, 3, 4, 5];
const avg: number = average(numbers);

console.log(`The average of ${numbers} is: ${avg}`);