Sean Paul Payne Dinwiddie

Redux Toolkit and Prompt example

Building a Redux Toolkit CLI App with prompt and JSON Persistence 🚀

As a developer, I'm always looking for ways to simplify my workflow and create more efficient tools 💻. Recently, I experimented with building a CLI app using Redux Toolkit (RTK) and prompt to create a simple command-line interface 📊. In this post, I'll walk you through the process of building this app and share the code on GitHub 📚.

The Problem 🤔

I wanted to create a CLI app that would allow me to increment and decrement a counter value, and persist the state to a JSON file 💾. This would allow me to easily save and load the state of the app, making it more useful for everyday tasks 📝.

The Solution 💡

To build this app, I used Redux Toolkit (RTK) to manage the state of the app, and prompt to create a simple command-line interface 📊. I also used the fs module to persist the state to a JSON file 💾.

The Code 💻

You can find the complete code for this app on GitHub: github.com/seandinwiddie/rtk-prompt-example