# fetch-least-priority-server

> get least online priority server

Latest version **1.0.1** (published 2021-02-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install fetch-least-priority-server
pnpm add fetch-least-priority-server
yarn add fetch-least-priority-server
bun add fetch-least-priority-server
```

## 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.1 |
| Published | 2021-02-28 |
| First published | 2021-02-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | aayush |
| Maintainers | techie_aayush |

## Links

- npm: https://www.npmjs.com/package/fetch-least-priority-server
- npm.io page: https://npm.io/package/fetch-least-priority-server

## Dependencies (2)

- [jest](https://npm.io/package/jest.md) ^26.6.3
- [axios](https://npm.io/package/axios.md) ^0.21.1

## Recent versions

- 1.0.1 (latest) — 2021-02-28

## README

A node package that determines the availability of a given list of servers and returns an online server having the least priority.

Alt text

example json data

[
    {
        "url": "http://doesNotExist.kratikal.com",
        "priority": 1
    },
    {
        "url": "http://kratikal.com",
        "priority": 7
    },
    {
        "url": "http://offline.kratikal.com",
        "priority": 2
    },
    {
        "url": "http://google.com",
        "priority": 4
    }
]

# Test the package

    On the command line, create a new test directory by the following command
    mkdir test-directory
    Switch to the new directory:
    cd /path/to/test-directory

In the test directory, install your module:

    npm install least-online-priority-server

    In the test directory, create a test.js file which requires your module and calls your module as a method, you can use the below code:

    // import created package
    const findServer = require('least-online-priority-server');
    // this is our example json data
    const sampleData = require('./data');
 
    // use the package to fetch lowest priority server from the json data list
    const response = findServer(data);
 
    // response
    response.then((res) => console.log(res));

   To test the package, on your command line run 'npm test' to run test cases for unit testing.

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