js-things
v0.7.1
Published
Eliminate some JS/TS labor.
Maintainers
Readme
js-things
Eliminate some JS/TS labor.
Usage
// ---- using a CDN (skypack example) ----:
import * as js_things from "https://cdn.skypack.dev/js-things?min";
// using TypeScript:
import * as js_things from "js-things";
const main_header = js_things.create_elem(
"header", // element tag name
document.body, // element parent (required)
"main-header", // optional element id
"header-styles" // optional element class
);
if (!main_header) {
js_things.show_err(
"Missing main header!", // error message
"error"
);
}
await js_things.wait(
3000, // delay in ms
new AbortController().signal // optional abort signal
);
console.info("Delayed this script part for 3 seconds");Documentation
Docs: JSDoc
Available functions (alphabetically):
create_elem();
debug_info();
// query selectors
doc_qs();
doc_qs_all();
show_err();
show_msg();
wait();
// accessibility
animations_accessibility();
btn_accessibility();
section_accessibility();