README -> Usage TOC -> Architecture Index -> API Index
m7-js-lib is a normalization-first singleton utility runtime for frontend JavaScript.
It is intended to be the shared core for m7 browser libraries and to reduce repetitive defensive code patterns in application logic.
m7-js-lib follows a pragmatic model:
- initialize one singleton core
- attach focused utility namespaces
- normalize/coerce broad input shapes into predictable outputs
- allow higher-level libraries to compose on top of stable helper contracts
This design keeps call sites linear and integration surfaces durable.
src/index.js exports init() and does not initialize on import.
src/auto.js imports index.js and immediately calls init() for convenience.
Core modules (bool, array, hash, number, str, func, utils, args, dom, require, service) prioritize broad input acceptance and predictable output contracts.
Bootstrap installs lib._env and resolves root/environment behavior (globalThis, window, or global) where needed.
Utility modules are installed in dependency order. Higher-level layers (dom, service, require, transport helpers) build on primitive layers.
- Singleton by intent.
- Readability and maintainability over optimization theater.
- Practical frontend performance.
- Predictable behavior under malformed/partial input.
- Ease of extension for other m7 modules.
m7-js-lib follows an ES6+ module posture and targets modern JavaScript runtimes.
Compatibility notes:
- Requires ES module support.
- DOM helpers require browser DOM APIs.
- Core non-DOM helpers can run in non-browser runtimes where applicable.
- No third-party runtime dependency is required by default.