This is a JavaScript Library for things I use often, as well as some helper functions.
Inspired by Habitat, another library that I help out with!
You can embed it into the browser like this: (I don't really use Modules, but I can convert it over to one if anyone wants it)
<script src="Elements.js"></script>You can use every function out-of-the-box, like so:
Elements.Limit.clamp() // or any other functionBut you can also install bits of the library into the global scope. For instance:
const { Colour, Meal } = ElementsYou can also easily rename each part to be whatever you like!
const { Colour: col, Meal: lang } = ElementsThere are currently 5 parts to this library - each individual and can technically be used on their own, but at the moment they are all in one file.
| Element | Usage | Documentation |
|---|---|---|
| Colour | Making colours | /docs/Colour.md |
| FSM | Finite State Machine - Speaks for itself | /docs/FSM.md |
| Limit | Restricting numbers between bounds | /docs/Limit.md |
| Meal | Consuming strings | /docs/Meal.md |
| Thread | Multiple things in sort of parallel | /docs/Thread.md |
You can find files for any aspect of this library in the /docs/ folder if you'd like to learn more.