mhulse / node-boilerplate-cli

A simple boilerplate starting point for Node.js command line projects.
Apache License 2.0
18 stars 9 forks source link

Docs: Give tip on why to use sync methods over async #22

Open mhulse opened 5 years ago

mhulse commented 5 years ago

Was discussing with coworker and I said this:

I highly recommend dicking around with node CLI stuff ... It's got less stuff to worry about as it's a CLI thing... The trick is to use sync methods as it's easier to manage the code

Typically for cli apps you don't want async

mhulse commented 5 years ago

Some other semi-related thoughts about this project:

I think this is a cool example of using node for CLI app: https://github.com/mhulse/kludgy if you look at code I do some cool tricks to use shell scripts and web page scraping ... That code is currently broken as I think Google maps change something on their API: https://github.com/mhulse/kludgy/issues/31 But I had a ton of fun writing that. Humble bragging aside, CLI node apps are fun because you don't have to do a bunch of web-related work, and you can hone ES6 node/JS skills for a small but useful project. For example, on Bitbucket private repos, I have done a ton of CLI apps to help me build printed books ... The key is obviously, having a tool you need to build. I love shell scripting and bash, but you can do all of that much easier in JS and installing node isn't so bad in terms of a system-level dependency.

mhulse commented 5 years ago

Or, use async/await, which is so much easier and non-blocking!