0.6.7 • Published 5 years ago
tiredjs v0.6.7
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.
0.6.7
5 years ago
0.6.6
5 years ago
0.6.5
5 years ago
0.6.4
5 years ago
0.6.3
5 years ago
0.6.2
5 years ago
0.6.1
5 years ago
0.6.0
5 years ago
0.5.3
5 years ago
0.5.2
5 years ago
0.5.1
5 years ago
0.5.0
5 years ago
0.4.0
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.0
5 years ago