“How to create a nodejs command line utility using cjs and typescript” — Part 1
Description:
This article series gives you a basic Idea on how to create a opensource command line utility project using Nodejs, Github Actions, and Jest
This article specifically focusses on creating a simple commandline utility using typescripe and cjs in nodejs.
See the package i created : https://www.npmjs.com/package/postman-collection-url-updater
Finding the purpose:
The first step of creating something is to find a purpose , a need on why we need something, ask your self following question
- What is the purpose of creating this (What problem does it solves)
- How often does people face this issue and looks out for a solution
- How much time does such a solution save
- What are the alternatives and its drawback
So, in my case there was a need of migrating the project from the URL structure {{baseURL}}/{{version}}/path1/path2 to {{baseURL}}/{{version}}/basepath/path1/path2
I could have just passed the additional path to version variable but doesn’t looks correct as the variable intention was to store just version . So I thought to create a npm command line…