# vyos-client

> VyOS HTTP API Client

Latest version **0.2.2** (published 2021-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vyos-client
pnpm add vyos-client
yarn add vyos-client
bun add vyos-client
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2021-02-16 |
| First published | 2021-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jack Foltz |
| Maintainers | foltik |
| Keywords | vyos, api-client |

## Links

- npm: https://www.npmjs.com/package/vyos-client
- Repository: https://github.com/Foltik/vyos-client-node
- Homepage: https://github.com/Foltik/vyos-client-node#readme
- Issues: https://github.com/Foltik/vyos-client-node/issues
- npm.io page: https://npm.io/package/vyos-client

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [form-data](https://npm.io/package/form-data.md) ^4.0.0

## Recent versions

- 0.2.2 (latest) — 2021-02-16
- 0.2.1 — 2021-02-16
- 0.2.0 — 2021-02-16
- 0.1.0 — 2021-02-16

## README

# vyos-client

[![npm](https://img.shields.io/npm/v/vyos-client)](https://www.npmjs.com/package/vyos-client)
[![docs](https://img.shields.io/npm/v/vyos-client?label=docs)](https://foltik.github.io/vyos-client-js/)
[![license](https://img.shields.io/github/license/Foltik/vyos-client-js)](https://github.com/Foltik/vyos-client-js/blob/main/LICENSE.md)
[![build](https://img.shields.io/github/workflow/status/Foltik/vyos-client-js/main)](https://github.com/Foltik/vyos-client-js/actions)

A simple to use client for the VyOS HTTP API.

For more information and setup instructions, see 
[docs.vyos.io/HTTP-API](https://docs.vyos.io/en/latest/configuration/service/https.html).

```typescript
import { Vyos } from 'vyos-client';
const client = new Vyos('https://my-vyos.local', 'API-KEY')

/* Modify configuration */
await client.config.get('system host-name') // 'my-vyos'
// 'my-vyos'
await client.config.set('system host-name', 'vyos')

/* Update OS images */
await client.images.add('https://downloads.vyos.io/rolling/current/amd64/vyos-1.4-rolling-202101301326-amd64.iso')
await client.images.remove('1.4-rolling-202101301326')

/* Run operational mode commands */
await client.ops.show('date')
// 'Mon 15 Feb 2021 10:54:54 PM EST\n'
await client.ops.generate('wireguard default-keypair');
```

For local testing, a Node.js repl is included.

Set the URL and KEY environment vars when running, or add them to a `.env` file.

```shell
$ npm install
$ npm run build
$ URL=https://my-vyos.local KEY=API-KEY npm run repl
v> await v.config.show('system host-name')
'my-vyos'
```

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