# online-status-checker

> A node module with a few methods to easily check if you're online or a certain website is reachable.

Latest version **1.0.5** (published 2018-09-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install online-status-checker
pnpm add online-status-checker
yarn add online-status-checker
bun add online-status-checker
```

## 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.5 |
| Published | 2018-09-16 |
| First published | 2018-09-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Steven Fernandez |
| Maintainers | stevenfernandez |
| Keywords | check if online, online status, check online status, is online check, network checker, online check, check url is available, check if url online, Angular check if online, Angular 6 |

## Links

- npm: https://www.npmjs.com/package/online-status-checker
- npm.io page: https://npm.io/package/online-status-checker

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2018-09-16
- 1.0.4 — 2018-09-16
- 1.0.3 — 2018-09-16
- 1.0.2 — 2018-09-16
- 1.0.1 — 2018-09-16
- 1.0.0 — 2018-09-16

## README

online-status-checker
=====================

A node module with a few methods to easily check if you're online or a certain website is reachable.

Install
=======

```
npm i online-status-checker --save
```


Simple Usage Examples:
======================


Import the Module:

```
import { checkNetworkConnection, checkServerIsReachable, checkInternetConnection } from 'online-status-checker';
```

Check if there is a network connection - returns true or false

```
const result = checkNetworkConnection();
console.log(result);
```

Check if a specific url is alive / reachable (Status: 200) or not - returns true or false

```
const url = 'http://someurl.com';
const result2 = checkServerIsReachable(url);
console.log(result2);
```

Check if browser is online - returns true or false

```
const result3 = checkInternetConnection();
console.log(result3);
```

Angular Example:

```
import { Component } from '@angular/core';
import { checkNetworkConnection, checkServerIsReachable, checkInternetConnection } from 'online-status-checker';


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  url = 'http://someurl.com';
  result1;
  result2;
  result3;

  constructor() {
    this.result1 = checkNetworkConnection();
    this.result2 = checkServerIsReachable(url); 
    this.result3 = checkInternetConnection();
  }


}

```

## Author

Steven Fernandez



## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


Changelog
=========

## [1.0.0] - 2018-09-16
### Added
- First Commit


## [1.0.1] - 2018-09-16
### Added Readme
- Added readme with example usage

## [1.0.2] - 2018-09-16
### Added Readme
- Added example for Angular 6


## [1.0.3] - 2018-09-16
### Added Readme
- Readme Tidy

## [1.0.4] - 2018-09-16
### Added Readme
- Readme Tidy

## [1.0.5] - 2018-09-16
### Updated Readme
- Code Updates

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