Sunday, December 18, 2022

Collaborating with ChatGPT to Create a High-Quality NPM Package in Record Time

How I Used ChatGPT to Write a Fully Documented and Tested Tool in ~3 hours

If you've ever tried to find a tool that does exactly what you need, only to come up short, you know the frustration of having to spend hours configuring and fiddling with existing solutions that just don't quite fit the bill. That's exactly what happened to me recently, when I set out to find a tool that could convert UML diagrams to JSON.

If at first you don't succeed... build your own I guess

After determining that nothing on the market quite fit the bill, I decided to take matters into my own hands and write my own tool. And thanks to the help of ChatGPT, I was able to do it in just three hours.  You can find it on github here: 

https://github.com/eejai42/uml-to-json

~3 hours instead of ~30!

With ChatGPT's assistance, I was able to crank out a fully documented, fully tested, and fully functional npm package that does exactly what I need it to do.  It would have taken me roughly an order of magnitude longer to do this work on my own, and I can tell you with 100% certain, the quality would not have been anything like what is in the package that we created, together, earlier today.

The package includes the code for the tool, instructions and examples for how to use it, code to test it, and instructions for how to run, use, and maintain those tests. It also includes a detailed list of dependencies, as well as instructions for how to update and maintain them over time, including nodejs itself.

And in a credits section, it gives credit to the author of the main library that I used to do most of the actual work.

Conclusion

All told, working with ChatGPT allowed me to produce maybe the highest quality tool I've ever written in my 30 years of coding – and I did it in a fraction of the time it would have taken me to do it on my own. 

No comments:

Post a Comment