Jotils is a JavaScript utility functions library.
The library is published to npm as a pacakge, and also exported to bit.dev as a collection of components, so you can install a specific function of the project without having to install the whole project, you can do it from here.
The project has 29 functions for the moment and continues to grow, you can contribute to this with pleasure.
- ✂️Zero dependencies
- 📦Functions can be installing separately
- ✅Functions are tested
Browse components and explore their props with Bit.
Install components and live demo
Every function have a live demo with docs and tests.
- array-diff
- async-for-each
- async-sleep
- create-array
- degrees-to-radians
- get-file-extension
- get-file-name
- get-longest-word
- get-longest-word-length
- get-random-color
- includes
- is-array
- is-boolean
- is-number
- is-object
- is-string
- is-undefined
- is-unique-in-array
- letter-count
- linear-interpolation
- percentage-calculator
- radians-to-degrees
- random
- random-between
- random-value-from-array
- remove-duplicates-in-array
- remove-value-from-array
- shuffle-array
- sum-array
Using npm to install jotils:
$ npm i --save jotils
const J = require('jotils');
Using bit to install a specific function:
set npm regisetry config(one time action)
npm config set '@bit:registry' https://node.bit.dev
$ npm i @bit/joshk.jotils.letter-count
const { letterCount } = require('@bit/joshk.jotils.letter-count');
- Pull requests and ⭐ stars are always welcome.
- For bugs and feature requests, please create an issue.
- For major changes, please open an issue first to discuss what you would like to change.
- Please make sure to update tests as appropriate.
Steps to contribute
- Fork the project and clone.
- Create folder for your function in this folder, name the folder and the function file in lower case, and the function with upper case. See example of naming in this folder folder.
- The function need to be exported with index file inside the folder function, so create index.ts file to export your function. (NOT USE EXPORT DEFAULT)
- Run
npm run createindexfile
to generate the main index.ts file in components folder that export all the functions. - Run
npm run build
to generate the build folder folder. - Run
npm run test
to check the functions. - Share with the community by submitting a PR.