This project help us to understand nodeJs.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
We will be building a CLI(command line) app that takes user input, which will be a page (or some other parameters), using a flag argument and uses this argument to make a http request to a REST API, the api we will be using is provided by www.themoviedb.org . The api provides information on a movie/person as requested using a parameter. We would consume this API to get the population of a country.
To parse CL arguments we will use Commander
, a node package. To make http requests we will use Http
Node Module .
Here's why:
- Learn more about the asyncronous workflow of Node.js
- Interact easily with 3rth APi's.
- Learn how to manipulate Tokens.
This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.
Node.js
Commander.Js
Dotenv
node-notifier
ora
spinnersprettier
First of all you need to have installed node and git into your PC.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- Get a free API Key at https://www.themoviedb.org/
- Clone the repo
git clone https://github.com/bbenalia/node-moviedb-cli
- Install NPM packages
npm install
- Enter your API in
.env
const API_KEY = 'ENTER YOUR API';
-
./moviedb.js command... ---options... --flags...
-
./moviedb.js get-persons --page 1 --popular
-
./moviedb.js get-persons --page 2 --popular
-
./moviedb.js get-person --id XXXXXXXX
-
./moviedb.js get-person --id 990393
-
./moviedb.js get-movies --popular --page 2
-
./moviedb.js get-movies --now-playing --page 2
-
./moviedb.js get-movie --id movieId
-
./moviedb.js get-movie --id 694919
If you want to save your data request use:
--save
--local
For more examples, please refer to the Documentation
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Thanks goes to these wonderful people (emoji key):
haykbit 💻 |
imalovelyghost 💻 |
Project Link: https://github.com/your_username/repo_name