New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ngrx-store-cli

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngrx-store-cli

A schematic to generate NgRx store slices

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

NgRx Store CLI

npm version GitHub

A schematic for Angular that simplifies the creation of NgRx store slices — including actions, reducers, selectors, and automatic integration with your app-state.ts.

✨ Features

  • 🚀 One command to generate full NgRx boilerplate
  • 🧱 Supports both flat and structured folder layouts
  • 🧩 Optional integration with a central app-state.ts file
  • 🧼 Automatically appends reducers + interface to your app state

📦 Installation

npm install ngrx-store-cli --save-dev

🚀 Usage

Generate a new store slice using command:

ng generate ngrx-store-cli:store feature-name --actions="actionOne,actionTwo" -a --path=your/path -s
ng g ngrx-store-cli:store user --actions="load,loadSuccess" -a --path=src/app/store -s

✅ Options

OptionAliasRequiredDescription
--nameName of the feature or slice
--actionsComma-separated list of action names to generate
--app-state-aAdd this flag to auto-generate and integrate with app-state.ts
--separate-files-sAdd this flag to generate separate folders for actions, reducers, etc.
--pathTarget path where files will be generated (default: src/app/store)

📁 Output Structure

🔹 Default (No --separate-files)

src/app/store/user/
├── user.actions.ts
├── user.reducer.ts
├── user.selectors.ts

🔸 With --separate-files (-s)

src/app/store/
├── actions/
│   └── user.actions.ts
├── reducers/
│   └── user.reducer.ts
├── selectors/
│   └── user.selectors.ts

📄 app-state.ts Example

When --app-state(-a) is passed, the schematic:

  • Generates app-state.ts if it doesn't exist
  • Appends your new reducer and interface to it
import { ActionReducerMap } from '@ngrx/store';
import { userReducer, UserState } from './user/user.reducer';

export interface AppState {
    user: UserState;
}

export const reducers: ActionReducerMap<AppState> = {
    user: userReducer
};

💡 Tip

You can pass both --app-state(-a) and --separate-files(-s) to fully customize your state structure.

📝 License

MIT

🤝 Contributions

PRs welcome!

Keywords

schematics

FAQs

Package last updated on 13 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts