1.0.1-0 • Published 3 years ago

spacetalk v1.0.1-0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Spacetalk

A Node CLI for SpaceX.

Usage

Use nvm to install Node 14.16.0. Follow instructions here per your machine.

npm install spacetalk -g

man spacetalk

spacetalk get all capsules

spacetalk get rocket 5e9d0d95eda69955f709d1eb

FAQ

This package has not been tested outside Mac OS and Debian with Node 14.16.0.

Q: node ./cli.js doesn't work.

A: If you are developing and have permission issues when running node ./cli.js, ensure to give file execution permission: chmod +x cli.js. For regular usage, you should not have to do that.

Q: npm install space -g doesn't work.

A. On Linux and other machines, if there's a permission denied error after running npm install spacetalk -g, you'll want to reinstall npm with a node version manager.

Q: man spacespace doesn't work.

A: To get man spacetalk to work on Linux, install man with apt install man-db.

Assumptions

  1. Could be extended to support a web service.
  2. Uses low-level language APIs or performant libs.
  3. Should it be a bash script or an npm package. Why not both? Npm lets us create modules that run as bash commands. It even supports roff files (man pages).

Decisions

Uses got for http library. I looked at npmtrends and compared http request libs. This was the comparison I ran. But then I wondered, which one is faster? I picked got and https to fetch data from /api.spacexdata.com/v4/capsules. Results were 3.387ms and 40.202ms. Decision has been to go with got also for its async functionality and developer friendliness.

Uses basic npm best practices so that the UI is accessible via the CLI.

1.0.1-0

3 years ago

1.0.0

3 years ago