short for "enough", but often "enough" is used to mean "lots of" โ Urban Dictionary
There are a lot of very powerful JS frameworks capable of doing very cool things, but a lot of simple content-oriented websites do not need that much power, sometimes to use less JavaScript is enough.
NUFF is a small collection of tiny independent libraries that aim to solve simple issues.
The whole NUFF is just 4.43 KB but each library can be used separately.
Each library included in NUFF respects this contract:
- runs in modern browsers;
- has no external dependencies;
- is written in standard ES JavaScript, no transpiling involved;
- exports also the classes used internally, not only the instances, so you could extend and modify them at runtime without the need to always fork the repository;
- is fully documented;
- is unit tested with 100% coverage.
Here are the libraries currently included in NUFF:
The LazyCustomElementRegistry class is a Custom Element registry for defining and upgrading custom elements in a lazy manner, plus some interesting additional features.
Standard DOM Event listening and dispatching, but on steroids.
It supports delegation, throttling, listen to / dispatch events from any JS object (not only DOM
elements), late listening to custom events being dispatched in the past.
Small utility to deal with data-attributes taking a namespace or prefix into account. It also takes care of type casting the values.
Like the standard element.classList but taking a namespace or prefix into account.
Small utility to read / write CSS variables (custom properties) taking care of type casting.
NUFF
Copyright (c) Federico Orru' and Contributors
Licensed on the terms of The Artistic License 2.0
This project is tested with BrowserStack.