Nano Stores is a lightweight and performant state manager designed for a wide range of JavaScript frameworks including React, Preact, Vue, Svelte, and vanilla JS. Currently stable at version 1.3.0, the library maintains an active release cadence, frequently introducing new features and improvements. Its core philosophy revolves around using many atomic, tree-shakable stores and direct manipulation, which contributes to its incredibly small footprint (294-831 bytes minified and brotlied) and zero external dependencies. Key differentiators include its focus on moving business logic out of components into dedicated stores, optimizing for speed by avoiding unnecessary selector calls, and providing first-class TypeScript support. This architecture ensures excellent tree-shaking, only bundling the stores actually used in a given chunk.
npm install nanostoresVerified import paths — ran on the pinned version, not inferred.
This example demonstrates creating an atomic store with `atom`, defining actions to modify it, deriving state with `computed`, and subscribing to changes using `listen` to observe state updates.
Upgrade your Node.js environment to version 20.0.0 or newer (or 22.0.0 for the latest recommended). The `engines` field in `package.json` specifies `^20.0.0 || >=22.0.0`.
For asynchronous computed stores, migrate to the `@nanostores/async` package. Update your imports and logic to use the dedicated async utilities from this new package.
If you are using deep map stores, migrate to the `@nanostores/deepmap` package. Update your imports and code to use the `deepmap` utility from this external package.
Use ES Module `import` syntax (`import { atom } from 'nanostores'`). Ensure your project is configured for ESM (e.g., by setting `"type": "module"` in `package.json` or using a bundler like Webpack/Rollup/Vite).Verify that the variable `$store` is indeed a store created by `atom()` or `computed()`. Also, ensure you are importing core store functions (e.g., `atom`, `computed`) from `nanostores` and framework-specific utilities (e.g., `useStore`) from their respective packages (e.g., `@nanostores/react`).
Upgrade your Node.js version to `20.0.0` or `22.0.0` (or newer) to meet the minimum engine requirements for Nano Stores v1.0.0 and above.
No dependency data recorded yet.