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

centum.js

v2.1.0

Published

Little polyfunctional library on JS for using in building webapps and just coding

Downloads

47

Readme

Centum.JS - small library on JS with different-scoped methods

Getting Started

import Centum from 'centum.js'** or **const Centum = require('centum.js')

    const centum = new Centum()

    console.log(centum.percent(12.5, 4850)) // 388 - and you can round result adding third argument
    import Centum from 'centum.js'
    
    const [cords, setCords] = useState([
        {lat: 55.3110, long: 82.7508}, 
        {lat: 54.9855, long: 82.9069}
    ])

    const centum = new Centum()
    
    console.log(centum.haversine([cords[0].lat, cords[0].long, cords[1].lat, cords[1].long], 0)) // 588 - distance in meters with 2% fault 

Centum.JS Documentation - https://github.com/Slavus54/centum-docs

Versions

1.0.0 - published on npmjs

1.0.1 - add specific functions for developing in React/Angular/Vue

1.0.2 - 1.0.3 - fixed some bugs with formatting and created README.md

1.0.4 - add hash function to work with strings and numbers, updated README.md

1.0.5 - haversine refactoring and probability function with inversion's condition

1.0.6 - 1.0.7 - created methods move(), credit(), subsequence()

1.0.8 - 1.0.9 - instead percent method add part() and percent(), which allows to get value by % and % by value

2.0.0 - created math() method to generate simple task with custom size and number's rank,
fixed bags, refactoring, published Centum.JS Docs on Preact with explanations, examples and codebox

2.0.1 - published phone() method, receive text and key convert/deconvert and validate phone number with any country code

2.0.2 - created method go(), which receive identifier (nick, tag or ID) and social media as 2 parameters and open new page in browser, also redirect to any URL by 1 parameter

2.0.3 - append method question(variants, right) to check answer given by argument on closure function, which use context of method

2.0.4 - added new calories calculator method calories(weight, distance, pulse) and average(nums, key) to count average number of array (row) or it median

2.0.5 - created method distance(num, key, convertTo, round) to convert distance into right format (mile, km and etc...) with rounding, updated and released documentation on Preact

2.0.6 - append methods calories() and average(). Updated UI of Documentation. Try new methods in codebox.

2.0.7 - 2.0.8 - new method distance(num = 1, key = 'km', convertTo = 'mile', round = 1) to convert distance in different formats. Updated search() method by adding parameter isFromBeginning.

2.0.9 - new react methods title(main = '', chapter = '') and favicon(title = 'favicon') to improve UX of your web app.

2.1.0 - append accident(order = 1) to get random number and mysort(arr = []) to sort array of number in increasing, updated documentation design.