npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zwolfrost/get.js

v1.2.0

Published

A JavaScript library that provides a bunch of useful, optimized and often math-related functions

Downloads

3

Readme

get.js

A JavaScript library that provides a bunch of useful, optimized and often math-related functions.

All versions are written in vanilla javascript (ES12) and have no dependencies.

 

Versions

| Version | Methods Available | JSDOC Documentation | Minification |:- |:-: |:-: |:-: | get.js | All methods | :heavy_check_mark: | :x: | get.min.js | All methods | :x: | :heavy_check_mark:

 

How to install

You can just install it like any npm package, npm i @zwolfrost/get.js use a cdn or copy the file from the src directory.

 

Changelog and Breaking Changes

Watch out for this section if you wish to migrate to a different version. New patches are usually bugfixes and/or documentation clarifications and only meaningful ones are written.

  • v1.1.0: Removed "call" method as i didn't feel like it fits in the package theme. Also because it was just the following code: window[name](...args) Added the "root" method.
    • v1.1.1: The imports' usage was finally corrected and the type of the package is specified in package.json (module).
  • v1.2.0: Added "prime_factors" and "extracted_root" methods.

 

How to use

Note that you can change the cdn version and/or package type of the library with whatever version you want. Template:

https://cdn.jsdelivr.net/npm/package@version/file.

Also note that you have to use an ES module to import as seen below, unless you want to use the CDN method

import get from "@zwolfrost/get.js";
//OR
import get from "https://cdn.jsdelivr.net/npm/@zwolfrost/[email protected]/src/get.js";

get.fraction(1.375, 2)
//returns [ 227, 165 ] because 227/165 = 1.3757575...

 

Object Methods

Instructions on parameters and details can be found in the JSDOC comments

| Method | Description |:-: |:- | intervals | Returns an array that contains the intervalling numbers between the two given numbers (or arrays). | pattern | Returns an array made up of the given length and number pattern. | unique | Returns an array made up of unique numbers (that never repeat) from the given one. | decimals | Returns the number of decimals in the given number. | fraction | Returns a fraction calculated from the given decimal number. Also works with repeating decimals, if specified. | random | Returns a random number between the two given numbers (inclusive). | normalized | Returns a normalized version of the given string (latin letters only). | time | Returns the current time of the day. | GCD | Returns the greatest common divisor between two given numbers. | LCM | Returns the least common multiple between two given numbers. | prime_factors | Returns an array that contains the prime numbers that multiply together to make the original number. | extracted_root | Returns an array that contains the extracted number and the one left in the root. | root | Returns the result of a root with the given number and index. | base | Returns a converted number (or a string) from & to the given bases. | performance | Returns the time to execute the given function in milliseconds.

 

Found a bug and/or need help?

Please open an issue on Github to request a change, report a bug or ask for help about something and i will look into it.