# pingster

> Pingster is the tool that allows you test any API requests that are used inside your apps and projects.

Latest version **1.0.6** (published 2018-05-25) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install pingster
pnpm add pingster
yarn add pingster
bun add pingster
```

Provides the command `pingster`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-05-25 |
| First published | 2018-01-26 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 7 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ZenMate Team |
| Maintainers | zenmate |

## Links

- npm: https://www.npmjs.com/package/pingster
- Repository: https://github.com/zenmate/pingster-core
- Homepage: https://github.com/zenmate/pingster-core#readme
- Issues: https://github.com/zenmate/pingster-core/issues
- npm.io page: https://npm.io/package/pingster

## Dependencies (7)

- [ora](https://npm.io/package/ora.md) ^2.1.0
- [async](https://npm.io/package/async.md) ^2.6.0
- [axios](https://npm.io/package/axios.md) ^0.18.0
- [yamljs](https://npm.io/package/yamljs.md) ^0.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^6.0.1
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [lodash.ismatch](https://npm.io/package/lodash.ismatch.md) ^4.4.0

## Recent versions

- 1.0.6 (latest) — 2018-05-25
- 1.0.5 — 2018-03-12
- 1.0.4 — 2018-02-23
- 1.0.3 — 2018-01-26
- 1.0.2 — 2018-01-26
- 1.0.1 — 2018-01-26
- 1.0.0 — 2018-01-26

## README

# Pingster

[![npm version](https://badge.fury.io/js/pingster.svg)](https://badge.fury.io/js/pingster)

> Never let your APIs down! Pingster is the tool that allows you test any API requests that are used inside your apps and projects. 

## Install

```bash
npm install pingster
```

## Usage

### CLI

In the root of your project create `pingster.yml` file that looks like:

```yaml
httpbin:
  url: https://httpbin.org/get?hello=world
  expect:
    status: 200
```

then run command inside your folder:

```bash
pingster
```

and it will test if that url returns `200` as you expect!

#### Options

```bash
Options:
  -c, --config            optional path to config file wtih .yml ext
  -d, --debug, --verbose  enable verbose logging mode
  -h, --help              print help
  -v, --version           print version
```

### Programmatic

It is also possible to use Pingster inside your code directly:

```js
const pingster = require('pingster');

const config = {
  httpbin: {
    url: 'https://httpbin.org/get?hello=world'
    expect: {
      status: 200
    }
  }
};

pingster.tester(config).then(testResults => {
  console.log(testResults);
});
```

#### API

- `loadConfig(path: String) -> Object` - load and parse YAML config file from specified path and get a config object in return
- `parseConfig(yaml: String) -> Object` - parse YAML string and get a config object in return
- `tester(config: Object) -> Promise` - run tests on APIs specified in config object, returns a Promise

### Config structure

```yaml
# api name
httpbin: 
  # api url that will be tested
  url: https://httpbin.org/get?hello=world
  # data that will be tested to match with response
  expect:
    status: 200
    data:
      foo: bar
      num: 123
      bool: true
      obj:
        key: value
    headers:
      content-type: application/json
```

## Pingster Tools

Furthermore you can also easily setup and self-host your own Pingster web service that will run API tests of your projects and show the results in beautiful UI. Here are the apps that will help you:

- [pingster-server](https://github.com/zenmate/pingster-server) - Node.js backend that provides REST API and scheduled Pingster test runner for your GitHub repositories
<!-- - [pingster-ui](https://github.com/zenmate/pingster-ui) - single-page app writen in React.js that uses [pingster-server](https://github.com/zenmate/pingster-server) API to display test results -->

---

---
_Source: https://npm.io/package/pingster · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
