Skip to content

markdg/cli-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI App

This is a sample command line application used in the JSReadme blog post. This cli app performs twitter search. This is meant to demonstrate how to build a cli app using Node.js.

Installation

Install the packages using NPM

npm install

Register for a Twitter app at Twitter Developers. Generate an access token for the app.

Once done, copy the configuration file to a new file called configuration.json

cp config/configuration.example.json config/configuration.json

Fill in the credentials on configuration.json.

Usage

Running with no arguments

Running without any arguments brings you to a prompt

node bin/birdie
prompt: query

Type in your search query and press enter. You should see the search results returned in JSON format.

Running with arguments

You can also pass in arguments. Arguments are assumed to be the query.

node bin/birdie foo

The search results for foo should return.

Running with options

You can change the results type of the results by passing in the r option.

node bin/birdie -r recent foo

Or the long option

node bin/birdie -resulttype recent foo

The r option takes in either mixed, recent or popular.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published