A tiny, modern, on-document-ready that runs any given function(s) once the document is ready or immediately if the document is ready already.
npm install readyjs --save
You can either use the es6 module dist/ready.js
or include the iffe
from dist/ready.iffe.js
straight into your build step or load it into your code.
// importing via es6 module syntax
import { ready } from '../node_modules/readyjs/dist/ready.js'
// used readyjs
ready(function(){
// your code here
})
// when using the IIFE
readyjs.ready(function(){
// your code here
})
PRs welcome.