kong-util
v0.7.12
Published
my own library for js
Downloads
283
Readme
kong-util
Here are some codes I usually use. Some runs in any environment that supports JavaScript (ES6 and later); but some is usable only in browsers.
Also see demo, API documentation, and changelog.
in browsers
traditional way
<script src="https://cdn.jsdelivr.net/npm/kong-util/dist/all.js"></script>
<script>
kongUtil.wait(100).then(() => console.log("tradition mode works"));
kongUtil.use();
$("body").append("this text will be appended to the bottom of the page.");
</script>
module way
<script type="module">
import kongUtil from "https://cdn.jsdelivr.net/npm/kong-util/mod/all.mjs";
kongUtil.$("body").append("this text will be appended to the bottom of the page.");
kongUtil.use();
wait(100).then(() => console.log("module mode works"));
</script>
in Node.js
install
npm install --save kong-util
use
// ES module
import kongUtil from "kong-util";
// both in ES module and CommonJS
import("kong-util").then(kongUtil => {
// codes here
});