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

@santi100/average-lib

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@santi100/average-lib

Santi's Advanced Averaging Library: Effortlessly find the average!

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

Santi's Small Summation 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.

    NameTypeDescriptionOptional?
    arraynumber[]The array whose average is to be calculated.No

Usage

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

// Example 1: Summing up numbers in an array
const arr = [1, 2, 3, 4, 5];
const result1 = sum(arr);
console.log(result1); // Output: 15

// Example 2: Summing up numbers in a range with a step
const fn = (n: number) => 1 / n;
const start = 1;
const end = 5;
const step = 2;
const result2 = sum(fn, start, end, step);
console.log(result2); // Output: 1.5333333333333332

Keywords

FAQs

Package last updated on 10 Jul 2023

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