Skip to content

Installation

Package Manager

bash
npm install @phpdot/statedb
bash
yarn add @phpdot/statedb
bash
pnpm add @phpdot/statedb
ts
// ESM
import { StateDB } from '@phpdot/statedb';

// CJS
const { StateDB } = require('@phpdot/statedb');

CDN

html
<!-- Production -->
<script src="https://unpkg.com/@phpdot/statedb/dist/index.min.js"></script>

<!-- Development -->
<script src="https://unpkg.com/@phpdot/statedb/dist/index.js"></script>
html
<script>
  const db = new StateDB('my-app');
</script>

What's Included

FileFormatUse case
index.mjsESMBundlers (Vite, Webpack, Rollup)
index.cjsCJSNode.js / require()
index.jsIIFEBrowser <script> tag (readable)
index.min.jsIIFEBrowser <script> tag (production)
index.d.tsTypeScriptType declarations

All files include source maps. No runtime dependencies.

MIT Licensed