
Immer
A JavaScript library that lets you update immutable state by writing ordinary mutating code.
- Stars
- 29k
- Forks
- 905
- Licence
- MIT
- Language
- JavaScript
- Last update
- 6 days ago
- Type
- Library
What it is
Immer is a JavaScript library for managing state without changing it directly. You write code that looks like it modifies a draft of your data, and Immer produces a new immutable copy with only the changed parts updated. The README describes it as a way to create the next immutable state tree by simply modifying the current tree. The README excerpt provided does not describe its APIs in detail, so this summary is limited to its stated purpose and topics such as Redux and reducers.
- Update nested fields in a state object in a reducer without manually copying each level
- Produce new immutable state snapshots while keeping the original state unchanged
Great for
- JavaScript developers who find hand-written immutable updates verbose or error-prone
- Teams managing nested state in Redux-style reducers
- Developers who want immutable data without learning a new state model
Not ideal for
- Projects that do not use JavaScript or TypeScript, since this is a JavaScript library
- Developers looking for a full state management framework, since the README presents Immer as a focused library for producing new state
How to get it
- 1
Install with a package manager
You'll need: Node.js
Install from npm
npm install immer - 2
Run it
- Install the package with npm.
- Read the documentation at https://immerjs.github.io/immer/ for the core API.
- Apply it to a state object in a reducer or update function and inspect the result.
- 3
Get the most out of it
- Read the official documentation for advanced usage and patterns.
- Check the release notes at https://github.com/immerjs/immer/releases when upgrading.
- Use it alongside Redux if your app already uses reducers, since the topics list it there.
Downloads
Strengths
- Lets you write update code in a mutating style while keeping state immutable
- Has a documentation site linked from the README
- Open source under the MIT license with an active project history
Trade-offs
- The README excerpt gives little detail on API usage or limits, so evaluation requires the full documentation
- Immutable-update libraries add a dependency and a new pattern for teams to learn
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| immer (this) | 29k | Library | beginner | 6 days ago | JavaScript developers who find hand-written immutable updates verbose or error-prone |
| immutable-js | 33k | Library | intermediate | 5 days ago | JavaScript developers managing application state that is updated often |
| redux-toolkit | 11.2k | Library | intermediate | 4 days ago | Developers already using or learning Redux for app state |
| redux | 61.4k | Library | intermediate | 16 days ago | Developers building larger front-end apps where many components share the same data |
| zustand | 58.9k | Library | beginner | 15 days ago | React developers who want simpler shared state than Redux |
| redux-saga | 22.4k | Library | intermediate | 12 days ago | React or other frontend developers already using Redux who need to manage async logic |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.