Install via npm

The recommended way to use Umi‑Time in production.

npm install umi-time
pnpm add umi-time
yarn add umi-time

Use via CDN

Great for demos, prototypes, and quick experimentation.

<script src="https://cdn.jsdelivr.net/npm/umi-time/dist/umi-time.min.js"></script>
<script src="https://unpkg.com/umi-time/dist/umi-time.min.js"></script>

Minimal Working Example

Copy‑paste this into an index.html file to verify everything works.

<!DOCTYPE html>
<html>
  <body>
    <h2>Umi‑Time Minimal Example</h2>

    <script src="https://cdn.jsdelivr.net/npm/umi-time/dist/umi-time.min.js"></script>
    <script>
      // Create a Layer 1 Umi‑Time value from the current UTC moment
      const umi = new UmiTime(new Date());

      // Output the canonical textual representation
      console.log(umi.format(UMI_EXTENDED));
    </script>
  </body>
</html>

Package Contents

The npm package includes only the compiled distribution files:

  • dist/index.js — ES module build
  • dist/index.cjs — CommonJS build
  • dist/index.d.ts — TypeScript definitions
  • dist/umi-time.min.js — Minified IIFE bundle for browsers (global UmiTime)

Source files, tests, and documentation remain in the GitHub repository and are not included in the npm package.

Versioning & Compatibility

  • Stable version: 1.x
  • Browser support: modern evergreen browsers
  • Builds:
    • ES module build (ESM)
    • CommonJS build (CJS)
    • Minified bundle for browsers (IIFE)
  • Node: 18+

TypeScript Support

Umi‑Time ships with full TypeScript definitions. All public APIs—including UmiTime, solar‑context and solar‑geometry helpers, error types, and format constants—are strongly typed and included in the npm package via dist/index.d.ts.

More Resources

Documentation
Developer
Project