domreadify v1.0.0
domreadify
A browserify transform to execute the script only on DOM ready.
If you have global dependencies that would be available only after loading the whole page,
the domreadify transform will allow to postpone export execution by executing the whole script on DOM ready event.
Installation
Install with npm:
npm install domreadify --save-devInstall with yarn:
yarn add domreadify --devThe package has no configurations.
Usage
Command line argument:
browserify src.js -o output.js --transform domreadifyor you can add the transform to your package.json:
{
"browserify": {
"transform": ["domreadify"]
}
}browserify src.js -o output.jsSee also
browserify-global-shim -
a browserify transform for replacing modules with global variables.
You probably will want to use browserify-global-shim and domreadify together:
first replace modules with global variables, then postpone the script execution to DOM ready
(when all global variables are available).
License
Copyright (c) 2019 Yuri Sitnikov. Licensed under the MIT license.
7 years ago