Socket
Socket
Sign inDemoInstall

stahr-tools

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stahr-tools

A simple lightweight package for array manipulation, string tools, and advanced math for Node.js


Version published
Weekly downloads
8
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Stahr Tools

New to 1.4.1 (2022-10-20)

+ Added: `WaitAsync` function
- Removed: Testing functions
= Github Repo listed at the bottom of the README

This is a collection of functions that I use in my projects. I have been using them for a while and I decided to put them in a separate package. I hope you find them useful.

Array Functions

ArrayTools.GetRandomItem(array)

Returns a random item from the array.

ArrayTools.GetRandomItems(array, count)

Returns an array of random items from the array. The number of items returned is determined by the count parameter.

ArrayTools.ReverseArray(array)

Reverses the order of the items in the array.

ArrayTools.ShuffleArray(array)

Shuffles the items in the array.

ArrayTools.SortArray(array)

Sorts the items in the array.

Number Functions

NumberTools.Add(number, number)

Adds two numbers.

NumberTools.Subtract(number, number)

Subtracts two numbers.

NumberTools.Multiply(number, number)

Multiplies two numbers.

NumberTools.Divide(number, number)

Divides two numbers.

NumberTools.SquareRoot(number)

Returns the square root of a number.

NumberTools.Power(number, number)

Returns the result of raising a number to a power.

And many more... (see the source code)

Installation

NPM

npm install stahr-tools

Source Code

  • Download the source code
  • Copy the stahr-tools folder to your project
  • Import the functions you need

Usage

Importing


// Import all functions

const st = require('stahr-tools');

// Import specific functions

const { GetRandomItem, GetRandomItems } = require('stahr-tools');

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Keywords

FAQs

Last updated on 20 Oct 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc