WyvernJS supports three install methods — npm for Node.js and bundler environments, ES module CDN imports for modern browsers using nativeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/wyvernjs/llms.txt
Use this file to discover all available pages before exploring further.
import syntax, and classic <script> tags for zero-setup browser usage with no build step whatsoever. All three methods expose the same dw, tf, fw, and sh globals or named exports, so you can swap between them without changing application code.
Install
- npm
- ES Module Imports
Install the package from npm. This gives you access to all four modules through the package’s named exports map.After installing, import the full bundle or individual modules by their export path (see Package Exports below).
Package Exports
When using npm, theexports field in package.json maps the following import paths to their source files:
| Import path | File |
|---|---|
@mchen_dragon/wyvernjs | main/wyvern.js (all four modules combined) |
@mchen_dragon/wyvernjs/firewyvern | main/firewyvern.js |
@mchen_dragon/wyvernjs/shuihu | main/shuihu.js |
@mchen_dragon/wyvernjs/diwu | main/diwu.js |
@mchen_dragon/wyvernjs/tianfeng | main/tianfeng.js |
The
package.json main field points to main/wyvern.js, so a bare require('@mchen_dragon/wyvernjs') in CommonJS environments loads the full bundle.Initialization
Importing or loading WyvernJS does not automatically activate all features. DiWu and TianFeng must be initialized before use. FireWyrm (fw) and ShuiHu (sh) are ready immediately — no init call required.
dw.init() accepts an optional params object. Pass false for any key to suppress that prototype addition:
tf.init(context, options) accepts two optional arguments:
context— defaults towindow. Passtfitself (or any plain object) to avoid touchingwindowat all:options— an object of feature flags. Every feature istrueby default; set a key tofalseto disable it:
Only browsers have been officially tested. Non-DOM TianFeng features (stores, async helpers,
throttle, safeParse, setTask, etc.) and all of FireWyrm are expected to work on ES9+ Node.js, but this has not been formally verified. DiWu is browser-only and should not be initialized in a non-browser environment.