As software engineers, we have an overwhelming array of tools at our disposal to get the job done. From debugging to deployment, it often feels like there's a tool for every possible task. But every once in a while, we come across a problem where the perfect tool doesn’t exist yet—especially when you’re working in a high-growth startup facing unique challenges.
The Challenge: Parsing Hundreds of Redirects
Recently, I ran into one of these moments while consolidating redirects for a website we host on Vercel. All our redirects were managed through the vercel.json file, and let me tell you, it was massive. Hundreds of lines, each representing a different redirect.
The challenge wasn’t just handling the sheer number of redirects. I also needed to share this information with stakeholders to strategize on what to keep, remove, or update. Now, imagine sending a 400+ line JSON file to a non-technical team member and asking for feedback. Yeah, not ideal.
The Solution: Building an Array to CSV converter
Any time I can save, for myself or others, is a win. This is the mindset I've been operating in as of lately. So, instead of putting everyone through the pain of dealing with JSON, I built a quick tool that converts an array of objects into a CSV file. That way, stakeholders could easily view and manage the redirects in a format they’re familiar with.
You can use the tool here.
This took just over an hour to build but has already saved hours of back-and-forth communication—and it will continue to save us time as we move forward.
How It Works
I built this tool using Next.js, Tailwind and shadcn for the UI. While Next.js might seem like overkill for a simple CSV generator, I wanted to future-proof the project by leaving room for additional features or more complex use cases. If you've read my previous posts, you know that Next.js is also one of my go-to tools.
The functionality is straightforward:
- Input the Data: You can paste your array of objects directly into an input field or use the sample data provided to get started quickly.
- Select the Headers: You choose the specific keys you want to include as headers in the CSV file. This feature is especially helpful if you're only interested in a subset of the data, allowing for a more focused and streamlined CSV output.
- Generate and Download: With a single click on "Download CSV," the tool processes your selection and instantly generates a CSV file for download, ready to be shared or reviewed.
Feel free to check out the repo if you want to dive deeper into the code.
The Power of Building Custom Tools
Sometimes, the best tool for the job is the one you create. While there’s no shortage of pre-built solutions out there, there’s something incredibly empowering about building something specifically tailored to your needs.
In this case, a simple CSV generator saved us time, improved communication with stakeholders, and will likely help streamline future tasks.