tiredjs

0.6.7 • Public • Published
logo

lib size NPM downloads NPM version latest pre-release MIT license

tiredjs, a solution for tired/bored front-end developers

  • 💨 a lightweight Javascript library
  • 🏁 designed to make using DOM/basic JS faster & more intuitive
  • 💡 useful in many specific & situational cases.
  • ⏱ with considerable time savings.
  • 🌎 available on npm & unpkg.com

I - TOC

II - Install

Via a CDN

Always before the others scripts ⚠️

    <script src="https://unpkg.com/tiredjs"></script>
    <script src="./src/main.js"></script>
</body>

Via NPM

npm i tiredjs

index.js

import 'tiredjs';
 
log('Hello World !');
 
ael(qs('button'), 'click', () => alert('Clicked !'));

III - Examples

index.js (src)

const rdmInt = int =>  Math.floor(Math.random() * int);
 
ready(qs('.component'), () => {
 
    log('Hello World !');
 
    ael(qs('.component-button'), 'click', () => alert('Button clicked !'));
 
    forl(qsa('.component ul li'), el => el.style.background = `hsl(${rdmInt(360)}, 50, 100`);
}

becomes...

index.js (dist)

 
const rdmInt = int =>  Math.floor(Math.random() * int);
 
document.addEventListener('DOMContentLoaded', () => {
    if (document.querySelector('.component')) () => {
        console.log('Hello World !');
        document.querySelector('.component-button').addEventListener('click', () => alert('Button clicked !'));
        for (let i = 0; i < document.querySelectorAll('.component ul li').length; i++) {
            const el = document.querySelectorAll('.component ul li')[i];
            el.style.background = `hsl(${rdmInt(360)}, 50, 100`;
        }
    }
})

IV - Build

npm run build

V - License

Under MIT license.

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i tiredjs

    Weekly Downloads

    1

    Version

    0.6.7

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • blyndusk