My opinionated list of JavaScript utilities.
Install with your package manager of choice:
$ yarn add matija-utils
$ npm i matija-utils
Check out the documentation here.
Import the functions you need:
import { range, groupBy } from "matija-utils";
for (const n of range(0, 5)) {
console.log(n); // 0, 1, 2, 3, 4
}
const x = [
{
name: "Ivan",
company: "Google"
},
{
name: "Kenny",
company: "Google"
},
{
name: "Joseph",
company: "Amazon"
}
];
groupBy(x, "company"); // {"Google":[{"name":"Ivan","company":"Google"},{"name":"Kenny","company":"Google"}],"Amazon":[{"name":"Joseph","company":"Amazon"}]}
And that's all there is to it!
- Small package size
- A multitude of useful utilities
- Fully documented and typed