centum.js
v2.1.0
Published
Little polyfunctional library on JS for using in building webapps and just coding
Downloads
47
Maintainers
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.