Build Your Own Developer tools in Node.js

Build Your Own Developer tools in Node.js

Build Your Own Developer tools in Node.js - I did a presentation a couple of years ago to JaxNode User Group about building your own tools. As a user, it is very common to find yourself repeating the same series of commands over and over again. Use Node.js to build developer tools that can be built quickly for the command-line.

Use Node.js to build developer tools that can be built quickly for the command-line.

I did a presentation a couple of years ago to JaxNode User Group about building your own tools. As a user, it is very common to find yourself repeating the same series of commands over and over again. In software development, you often hear about the  SOLID principles. One of those principles is the DRY principle, which stands for Don’t Repeat Yourself.

If you don’t want to repeat yourself as a developer, why would you want to do it as a user? This is one of the reasons why I build my own tools. Here are some examples of tasks I ran across where I built my own tools.

  • I created a command-line tool for generating thumbnails for iOS and Android apps
  • I also created a tool for generating a markdown folder for new blog posts
  • I then created a tool for generating a new Node.js project

Command Line Tools

I have used a couple of different frameworks for creating command-line tools with Node.js. You don’t have to use Node.js. Python and Shell scripts are also popular for creating command-line tools. You can even use C.

When using Node.js for command-line tools, there are a couple of popular frameworks. The first one that became popular was  Commander by TJ Holowaychuk. Commander is still a very popular framework.

Oclif

Lately, I have been using  Oclif. This was developed out of  Heroku for their command-line tool. Their parent company Salesforce then used it to build SFDX.

Oclif is feature-rich with the ability to create multiple commands, add plugins and use either TypeScript or JavaScript for developing your utilities. I will use Oclif for my examples in this post.

Creating a New App in Node.js

When I am testing out a new NPM package that I might want to use or testing a new JavaScript feature in Node.js, I usually do a number of things to set up a new project. The tasks I go through are usually as follows;

  1. Create a directory and change into that directory
  2. Init a new project using NPM
  3. Create a README file
  4. Create a .gitignore file
  5. Create an index.js file for the start of my application
  6. Initialize a git repo, and commit all of the files

javascript coding programming nodejs

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Principles of Functional Programming in JavaScript That Will Make Your Coding Life Easier

Who else loves to write side-effects-free functions? I think we, as programmers, all do. Today, in this story, I will walk you through the basic principles of functional programming that will make your coding life easier.

4 Ways You Can Get Rid of Dirty Side Effects for Cleaner Code in JavaScript

4 Ways You Can Get Rid of Dirty Side Effects for Cleaner Code in JavaScript. Bugs are born in many ways. Creating side effects is one of them. Some people say side effects are evil, some say they’re not.

Who Else Wants to Write Clean JavaScript Code?

Who Else Wants to Write Clean JavaScript Code? 7 Tips to Make Your Coworkers Fall in Love With Your Code.

Code Formatting with Prettier in Visual Studio Code

Formatting code consistently is a pain, especially when working on a team. The beauty of modern-day web development is that the tooling has gotten so much better! In this article, we will look at setting up Prettier to automatically format your code in Visual Studio Code.

Top 15 Simple Coding Techniques to Get Your Tasks Done with Shorter Code in JavaScript

Don’t waste time writing long code while you can make it short, yet clearer and easier to read. In this Javascript tutorial, we'll discuss 15 Simple Coding Techniques to Get Your Tasks Done with Shorter Code in JavaScript