Registry / testing / atmn
library1.1.8jsnpmunverified

atmn is TypeScript library for managing application state with a focus on immutability and type safety. The current stable version is 1.1.8, released with weekly updates. It provides a simple atom-based state management pattern, similar to Recoil or Jotai, but with full TypeScript inference and minimal boilerplate. It supports both React and vanilla JavaScript, and includes built-in devtools for debugging.

npm install atmn
INSTALL
IMPORT
SIG · ATMN
A
atmn
testingjavascriptv1.1.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

atom
import { atom } from 'atmn'
const { atom } = require('atmn')
atmn is ESM-only; CJS require will fail.
useAtom
import { useAtom } from 'atmn'
import useAtom from 'atmn'
useAtom is a named export, not default.
type Atom
import type { Atom } from 'atmn'
import { Atom } from 'atmn'
Atom is a TypeScript type, use type-only import to avoid runtime overhead.

Creates a simple counter with an atom and useAtom hook, demonstrating basic state management in React.

import { atom, useAtom } from 'atmn'; const countAtom = atom(0); function Counter() { const [count, setCount] = useAtom(countAtom); return ( <div> <p>Count: {count}</p> <button onClick={() => setCount(count + 1)}>Increment</button> </div> ); }
Debug
Known issues
breakingIn v1.0.0, atom() required an initial value; in v1.1.0 it became optional (defaults to undefined).
fix
Upgrade to v1.1.0+ or provide initial value explicitly.
affects: <1.1.0
deprecatedThe function `useAtomValue` is deprecated in v1.1.0 and will be removed in v2.0. Use `useAtom` instead.
fix
Replace `useAtomValue(atom)` with `const [value] = useAtom(atom)`.
affects: >=1.1.0
gotchaAtoms are frozen by default; attempting direct mutation will throw in strict mode.
fix
Use the setter function returned by useAtom or the `set` method on atom store.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'atmn' or its corresponding type declarations.
Missing TypeScript types or using CJS require instead of ESM import.
fix
Install package: npm install atmn; use import syntax.
TypeError: object is not extensible
Attempting to directly mutate an atom's state.
fix
Use setter from useAtom or atom's set method.
Module '"atmn"' has no exported member 'useAtomValue'.
useAtomValue was deprecated and removed.
fix
Use useAtom instead.
Upgrade
Version history
1.1.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
packageatmn
atmn — npm install atmn · libregistry