My Profile Photo

Personal Webpage of David Duggins


Well, I was born on a normal day in July, 1981 and have been creating chaos ever since. Born in North Carolina, but raised in the aftermath of the Soviet Union, Kazakhstan, I have been messing around with computers nearly my entire life. I wrote my first program in assembly when I was 11. In my early teens I ran a BBS connected to Fidonet and started building a website for my band. In 1999 I was introduced to Linux, and it was love at first compile. I started my career in IT in the early 2000's doing IT for a Car Dealership in Charlotte NC. I wrote my first major web app in Cold Fusion (an ecom app) at that time. In 2006 I left Charlotte and moved down to Columbia where starting working as a developer, freelancer and consultant. Currently I am working as a freelance developer and DevOps consultant!!


Writting a Command Line Tool in Node Js.

As I have been doing more and more in Node JS, it hit me that I have made a few sites, but never a command line tool. I am a big fan of the command line. So I thought, let me make a neat little tool just to see how it all fits together.

To see the finished product check this out.

Ok, so lets get this party started!

Two main items of importance are the package.json file and the bin file.

{
    "name": "name-gen",
    "version": "1.0.0",
    "license": "MIT",
    "bin": {
        "name-gen": "bin/name-gen"
    },
    "scripts": {},
    "devDependencies": {
        "chai": "^4.2.0"
    },
    "dependencies": {
        "minimist": "^1.2.0"
    }
}

Aside from the dependencies (minimist for the app and chai for testings) notice the “bin” node. I am pointing to a file in a folder called bin/. This file has details on running the application.

The file bin/name-gen contains a single line require ('../src/')(). It’s loading all the code in my source folder.

In the src/ folder you will find a Node JS application.

© 2024 David Duggins. All rights reserved.