kong-util

0.7.10 • Public • Published

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
});

Readme

Keywords

none

Package Sidebar

Install

npm i kong-util

Weekly Downloads

4

Version

0.7.10

License

UNLICENSED

Unpacked Size

169 kB

Total Files

43

Last publish

Collaborators

  • kong0107