installation
Install jsjiit 0.0.22 from jsDelivr or npm. After that, Quick start guide. Bundles come from Build and distribution.
Channels#
flowchart LR src["src/index.js"] esbuild["build.mjs"] min["dist/jsjiit.min.esm.js"] esm["dist/jsjiit.esm.js"] registry["npm [email protected]"] jsdelivr["cdn.jsdelivr.net"] src --> esbuild esbuild --> min esbuild --> esm min --> registry esm --> registry registry --> jsdelivr
Same artifacts, two ways in: a versioned CDN URL, or npm install [email protected].
This documentation is the 0.0.22 tree. Published npm/jsDelivr may already be newer. Confirm with npm show jsjiit version before pinning a different tag. Do not copy APIs from a newer CDN into this tree.
Runtime#
| Requirement | Notes |
|---|---|
| ES2020+ | build.mjs target: ["es2020"] |
| Browser | Chrome 80+, Firefox 74+, Safari 13.1+, Edge 80+ is a reasonable floor |
| ESM | <script type="module"> or a bundler that understands ESM |
| Not Node | window.crypto.subtle and document in download_marks |
CDN#
<script type="module">
import { WebPortal } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/jsjiit.min.esm.js";
const portal = new WebPortal();
</script>
flowchart TB url["https://cdn.jsdelivr.net/npm/jsjiit@VERSION/dist/FILE"] url --> v["0.0.22"] url --> f["jsjiit.min.esm.js or jsjiit.esm.js"]
| URL | Use |
|---|---|
https://cdn.jsdelivr.net/npm/[email protected]/dist/jsjiit.min.esm.js |
Production, matches this source version |
https://cdn.jsdelivr.net/npm/[email protected]/dist/jsjiit.esm.js |
Readable + source map |
https://cdn.jsdelivr.net/npm/jsjiit/dist/jsjiit.min.esm.js |
Whatever npm latest is, may not be 0.0.22 |
The README in this clone still documents @0.0.20. Treat that as stale.
npm#
npm install [email protected]
flowchart LR imp["import from 'jsjiit'"] exp["package.json exports.import"] file["dist/jsjiit.esm.js"] imp --> exp --> file
import { WebPortal } from "jsjiit";
Resolution:
| Field | Path | Who looks |
|---|---|---|
exports.import |
./dist/jsjiit.esm.js |
Node ESM, modern bundlers |
exports.require |
./dist/jsjiit.esm.js |
Same file, still ESM |
module / browser |
dist/jsjiit.esm.js |
Older bundlers |
main |
src/index.js |
Fallback, needs a bundler |
Tarball contents (files: dist, src):
node_modules/jsjiit/
dist/
jsjiit.min.esm.js
jsjiit.min.esm.js.map
jsjiit.esm.js
jsjiit.esm.js.map
src/
index.js
wrapper.js
encryption.js
attendance.js
registration.js
exam.js
exceptions.js
feedback.js
utils.js
package.json
.npmignore drops docs, node_modules, run_server, certs, .vscode, index.html.
Direct paths#
import { WebPortal } from "./node_modules/jsjiit/dist/jsjiit.min.esm.js";
import { WebPortal } from "./node_modules/jsjiit/dist/jsjiit.esm.js";
import { WebPortal } from "./node_modules/jsjiit/src/index.js";
Source imports pull wrapper.js and friends. Serve them as modules or let a bundler follow them.
| File | Minified | Typical use |
|---|---|---|
dist/jsjiit.min.esm.js |
yes | CDN / production |
dist/jsjiit.esm.js |
no | npm default export |
src/index.js |
no | local work |
Version#
flowchart TD pin["Pin 0.0.22 for these docs"] --> check["npm show jsjiit version"] check -->|same| stay["Keep 0.0.22"] check -->|newer| read["Read that version's wrapper.js"]
npm list jsjiit
npm show jsjiit version
npm install [email protected]
The library does not export its version string. Read package.json.
Smoke test#
<script type="module">
import { WebPortal } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/jsjiit.min.esm.js";
console.log(typeof WebPortal);
const portal = new WebPortal();
console.log(typeof portal.student_login);
</script>
| Check | Pass |
|---|---|
| Import | no syntax error |
typeof WebPortal |
"function" |
new WebPortal() |
object with session === null |
portal.student_login |
"function" |
| Symptom | Fix |
|---|---|
Cannot use import statement |
type="module" |
| CDN 404 | version not on npm |
jsjiit unresolved after install |
import 'jsjiit', not a relative guess |
crypto.subtle undefined |
HTTPS or localhost |