An open API service indexing awesome lists of open source software.

https://github.com/blackiq/cli-wrapper

The simple nodejs http wrapper you can use in your terminal or app.
https://github.com/blackiq/cli-wrapper

api cli-wrapper express http-wrapper nodejs request

Last synced: 7 months ago
JSON representation

The simple nodejs http wrapper you can use in your terminal or app.

Awesome Lists containing this project

README

          

# CLI Wrapper

**CLI Wrapper** is command line wrapper you can install to use in your terminal. You can even use it in your apps.

In this instructure you will learn about how to use this package in your apps.

## Table of content

- [Installation](#installation)
- [Run]($run)

- [Development](#development)

## Installation

How to install **CLI Wrapper**? To install this package, use **NPM**.

```shell
$ npm i -g @blackiq/cli-wrapper
```

> We use `-g` to install the package **globally**.

## Run

Ok, to run the wrapper, just enter this command in your terminal:

```bash
$ cli-wrapper
```

You are now running it in port 3000. If you want to use your own port, use `--port`.

```bash
$ cli-wrapper --port 8000
```

All done!

---

## Development

If you want to develop the package, it is so simple. just follow steps below.

- Clone the project
- Install dependencies by running `$ npm install`
- Start changing!
- Link package
- Test

> Before you start: **Remember the base or code are stored in `lib/wrapper.js`**. You need to edit there.

### Cloning the project

To clone the project, you need to have git installed. Ok, now clone it same as command below.

```shell
$ git clone https://gitlab.com/BlackIQ/cli-wrapper
```

### installing dependencies

Next, install what package uses with `npm i` or `npm install`.

```shell
$ npm i
```

### Changing

To change package or anything, your need a testing environment to use linked package. Just follow steps.

#### Link package

We asoume you are in `lib` directory. Right. You can open a **tmux** or in another terminal to cd in `test` directory.

In `lib` directory enter link command:

```shell
$ npm link
```

So, in other terminal, or other tmux part, link your development package to your `test` directory. If you are in the `test` directory ok, if not, just say `cd test` and enter the linking command:

```shell
$ npm link cli-wrapper
```

Linking step is done.

#### Test

Your test app is linked. Change anything in package and test it in `test` directory.