# status-is-ok

> Check if the url is 200-A-Ok 🎈 [![NPM version](https://img.shields.io/npm/v/status-is-ok.svg?style=flat)](https://www.npmjs.com/package/status-is-ok) [![NPM download count](https://img.shields.io/npm/dm/status-is-ok.svg?style=flat)](https://www.npmjs.com

Latest version **1.2.4** (published 2022-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install status-is-ok
pnpm add status-is-ok
yarn add status-is-ok
bun add status-is-ok
```

## 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.2.4 |
| Published | 2022-01-27 |
| First published | 2017-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ezekiel |
| Maintainers | theatlasroom |
| Keywords | 200, http, status, OK |

## Links

- npm: https://www.npmjs.com/package/status-is-ok
- Repository: https://github.com/theatlasroom/status-is-ok
- Homepage: https://github.com/theatlasroom/status-is-ok#readme
- Issues: https://github.com/theatlasroom/status-is-ok/issues
- npm.io page: https://npm.io/package/status-is-ok

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.21.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.4 (latest) — 2022-01-27
- 1.2.3 — 2021-10-16
- 1.2.2 — 2021-05-15
- 1.2.1 — 2021-05-15
- 1.2.0 — 2020-04-12
- 1.1.1 — 2019-07-21
- 1.1.0 — 2017-01-03
- 1.0.0 — 2017-01-02

## README

# Status-is-ok
Check if the url is 200-A-Ok 🎈
[![NPM version](https://img.shields.io/npm/v/status-is-ok.svg?style=flat)](https://www.npmjs.com/package/status-is-ok) [![NPM download count](https://img.shields.io/npm/dm/status-is-ok.svg?style=flat)](https://www.npmjs.com/package/status-is-ok) [![license](https://img.shields.io/github/license/theatlasroom/status-is-ok.svg?style=flat)](https://www.npmjs.com/package/status-is-ok)

## Installation
npm: `npm install status-is-ok`
yarn: `yarn add status-is-ok`

## Usage
### Function
```
const IsOk = require('status-is-ok')
IsOk('http://xkcd.com')
```

### Callback
```
const IsOk = require('status-is-ok')
const isUrlOk = new IsOk()
isUrlOk.check('http://xkcd.com', callback)
```

### Promise
```
const IsOk = require('status-is-ok')
const isUrlOk = new IsOk();
isUrlOk.check('http://xkcd.com')
  .then(function)
  .catch(function)
```


The module exposes just a single function:
```
.check(url, [callback])
```
- this checks the url is ok, and will return a promise or return via the callback if one is specified

The callback and promise will return an object with the following keys:
```
{
  isOk: boolean | returns false on a failure
  status: status code returned | returns 404 on a failure
  message: status message
  error: any errors encountered | empty on a successful check
}
```

## Development
linting `yarn lint // or npm run lint`
running the test suite `yarn test // or npm test`

## Todo
* [x] check if the requested url is 200 status (OK)
* [x] write some tests
* [ ] handle arrays
* [ ] cli

## License
[MIT license](http://opensource.org/licenses/MIT)

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