powerup

1.1.0 • Public • Published

PowerUP

Extension library for JavaScript prototypes with commonly used features

Description

PowerUP extends Javascript's capabilities by expanding the built-in prototypes of objects. After importing, these functions and properties can be used just as if they were native ones for rapid development.

Installation

Install the library with the package manager of your preference and add it to your project.

npm install --save powerup
yarn add powerup
pnpm add powerup
bun add powerup

Importing

After the package is imported, it will update the built-in prototypes in the currently running instance. Because of this, the package does not need to be assigned or called directly.

CommonJS

require('powerup')

ES6

import 'powerup'

Usage

All objects

const a = { x: 13, y: false }

let aJson = a.json() // Convert to json
let aCopy = a.deepCopy() // Create a deep copy

Arrays

const a = [ 1, 2, 3, 3, 3 ]

let min = a.min()
let max = a.max()
let sum = a.sum()
let avg = a.avg()
let prod = a.prod()
let unique = a.distinct()

This project is actively being worked on and more features are coming soon!

Package Sidebar

Install

npm i powerup

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

3.67 kB

Total Files

4

Last publish

Collaborators

  • dubniczky