-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Here is the documentation for super-x
.
-
Use npm to install it as a dependency:
npm install super-x
-
Import the exports of this lib:
import { /* ... */ } from "super-x"; // or const { /* ... */ } = require("super-x");
-
Use them in your code.
-
Include one of the following script tags in your HTML file:
via jsdelivr:
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/super-x@latest/dist/super-x.umd.min.js"></script>
or via unpkg:
<script type="text/javascript" crossorigin="anonymous" src="https://unpkg.com/super-x@latest/dist/super-x.umd.min.js"></script>
-
Access the APIs via the
X
global.const { /* ... */ } = X;
If you want a specified version, just replace latest
with that in the url. By the way, it is recommended to use a specified version in production.
For more information about these two CDN sites, visit www.jsdelivr.com and unpkg.com.
super-x
depends on some features like Map
and requestAnimationFrame
. Therefore, if you want to use super-x
in some older environments that don't support them, remember to include a polyfill lib to fix them.
For instance, include hpolyfill
by putting one of the following script tags in your HTML: (It should be loaded before other scripts.)
<!-- via jsdelivr: -->
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/hpolyfill@latest/dist/index.js"></script>
<!-- or via unpkg: -->
<script type="text/javascript" crossorigin="anonymous" src="https://unpkg.com/hpolyfill@latest/dist/index.js"></script>