open-index/open-npm huggingface dataset:
npm package: @serve.zone/platformclient
Description: a module that makes it really easy to use the serve.zone platform inside your app
Author: Task Venture Capital GmbH
Latest version: 1.1.2

# @serve.zone/platformclient
a module that makes it really easy to use the serve.zone platform inside your app

## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@serve.zone/platformclient)
* [gitlab.com (source)](https://gitlab.com/serve.zone/platformclient)
* [github.com (source mirror)](https://github.com/serve.zone/platformclient)
* [docs (typedoc)](https://serve.zone.gitlab.io/platformclient/)

## Status for master

Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/serve.zone/platformclient/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/serve.zone/platformclient/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@serve.zone/platformclient)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/serve.zone/platformclient)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@serve.zone/platformclient)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@serve.zone/platformclient)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@serve.zone/platformclient)](https://lossless.cloud)

## Usage
Use TypeScript for best in class intellisense
For further information read the linked docs at the top of this readme.

## Legal
> MIT licensed | **&copy;** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
npm package: @serve0/cloudflare
Description: Cloudflare DNS provider for serve0 ACME DNS-01 challenges
Latest version: 0.0.1

# @serve0/cloudflare

Cloudflare DNS provider for serve0 ACME DNS-01 challenges.

## Installation

```bash
npm install @serve0/cloudflare
```

## Usage

```typescript
import { DNSProvider } from '@serve0/core';
import { CloudflareDnsProvider } from '@serve0/cloudflare';

// Use with ACME interfaces
const dnsProvider: DNSProvider = new CloudflareDnsProvider({
  apiToken: process.env.CLOUDFLARE_API_TOKEN,
});
```

## License

MIT
npm package: @serve0/core
Description: A programmable reverse proxy and edge gateway written in TypeScript
Latest version: 0.0.1

# @serve0/core

High-performance, programmable reverse proxy and edge gateway core for serve0.

## Installation

```bash
npm install @serve0/core
```

## Usage

```typescript
import { serve0 } from '@serve0/core';
import { ConsoleLoggerPlugin } from '@serve0/logger';

const app = serve0();

app.handle('localhost', {
  route(req) {
    if (req.url?.startsWith('/api')) {
      return 'http://localhost:4000';
    }
    return 'http://localhost:3000';
  },
});

app.plugin(new ConsoleLoggerPlugin());

const { stop } = await app.serve(8080);
```

## License

MIT
npm package: @serve0/route53
Description: AWS Route53 DNS provider for serve0 ACME DNS-01 challenges
Latest version: 0.0.1

# @serve0/route53

AWS Route53 DNS provider for serve0 ACME DNS-01 challenges.

## Installation

```bash
npm install @serve0/route53
```

## Usage

```typescript
import { DNSProvider } from '@serve0/core';
import { Route53DnsProvider } from '@serve0/route53';

// Use with ACME interfaces
const dnsProvider: DNSProvider = new Route53DnsProvider({
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  region: 'us-east-1',
});
```

## License

MIT
npm package: @server-state/cpu-overview-extension
Description: A CPU info extension for Server State servers
Author: fliegwerk
Latest version: 0.3.2

# `@server-state/cpu-overview-extension`

!["Built for Server State" badge](https://img.shields.io/badge/Built%20for-Server%20State-%23ffc107)
![npm (scoped)](https://img.shields.io/npm/v/@server-state/cpu-overview-extension)

## Overview

This extension adds basic info about the installed CPU(/-s) detected on the system to the Server State APIs.

## Installation

This is intended to be installed on Server State servers.

Use the built-in functionalities to install this extension. For more details, please refer to the [Server State documentation](https://www.server-state.tech/docs/).

Alternatively, in your server, use `npm install @server-state/cpu-overview-extension -w plugins` to manually install the extension.

## GraphQL Schema Extensions

<!--
This extension doesn't extend the Server State GraphQL schema.
-->

This extension extends the GraphQL schema. For technical details, please refer to [the schema extension definition](./src/schema.graphql).
npm package: @server-state/disk-usage-module
Description: A module to view the current disk usage on your system
Author: server-state
Latest version: 0.1.2

# disk usage module

[![Build Status](https://travis-ci.com/server-state/disk-usage-module.svg?branch=master)](https://travis-ci.com/server-state/disk-usage-module)
![GitHub](https://img.shields.io/github/license/server-state/disk-usage-module)
[![npm version](https://badge.fury.io/js/%40server-state%2Fdisk-usage-module.svg)](https://badge.fury.io/js/%40server-state%2Fdisk-usage-module)
[![Coverage Status](https://coveralls.io/repos/github/server-state/disk-usage-module/badge.svg?branch=master)](https://coveralls.io/github/server-state/disk-usage-module?branch=master)
![module type: official](https://img.shields.io/badge/module%20type-official-%23015ba0)

A module to view the current disk space of devices in your system.

You can specify the moint points in the given options, for example:
```javascript
server.addModule('diskUsage', require('@server-state/disk-usage-module'), [
    '/'
]);
```

with the following output:
```json
{
 "title": "virtualRoot",
 "children": [
  {
   "title": "/",
   "children": [
    {
     "title": "free",
     "children": [
      {
       "title": "available",
       "size": 26725240832
      },
      {
       "title": "reserved",
       "size": 3452747776
      }
     ],
     "size": 30177988608
    },
    {
     "title": "used",
     "size": 36926201856
    }
   ],
   "size": 67104190464
  }
 ]
}
```
The output is specified in [data formats](https://github.com/server-state/specs/blob/master/arch/data-formats.md).

The output generates a straight base to provide other applications useful information like server-states example [client-base](https://github.com/server-state/client-base).

This official module belongs to the organization [server-state](https://github.com/server-state).
npm package: @server-state/linux-raid-module
Description: A module to view the current active raids based on /proc/mdstat generated by the linux-raid kernel module
Author: server-state
Latest version: 0.1.6

# Linux raid module

[![Build Status](https://travis-ci.com/server-state/linux-raid-module.svg?branch=master)](https://travis-ci.com/server-state/linux-raid-module)
![GitHub](https://img.shields.io/github/license/server-state/linux-raid-module)
[![npm version](https://badge.fury.io/js/%40server-state%2Flinux-raid-module.svg)](https://badge.fury.io/js/%40server-state%2Flinux-raid-module)
[![Coverage Status](https://coveralls.io/repos/github/server-state/linux-raid-module/badge.svg?branch=master)](https://coveralls.io/github/server-state/linux-raid-module?branch=master)
![module type: official](https://img.shields.io/badge/module%20type-official-%23015ba0)

This module parses the file /proc/mdstat generated from the Linux raid kernel module and extracts useful information, for example, raid name, current devices with their status, activities.

The `/proc/mdstat` file might look like this:
```
Personalities : [raid1] [raid0] 
md126 : active raid1 sdb20[2](R) sdb2[1] sdb1[0]
      20954112 blocks super 1.2 [2/2] [UU]
      [==============>......]  recovery = 74.4% (15600512/20954112) finish=3.2min speed=27496K/sec
      
unused devices: <none>

```

For it, the parsed JSON output would look like this:
```json
{
   "personalities": [
      "raid1",
      "raid0"
   ],
   "raids": [
      {
         "name": "md126",
         "state": "active",
         "access": "rw",
         "type": "raid1",
         "unique": "myRaid",
         "devices": [
            {
               "name": "sdb20",
               "index": 2,
               "status": "rescue"
            },
            {
               "name": "sdb2",
               "index": 1,
               "status": "active"
            },
            {
               "name": "sdb1",
               "index": 0,
               "status": "active"
            }
         ],
         "blocks": 20954112,
         "parameters": "super 1.2",
         "ideal": 2,
         "current": 2,
         "options": [
            {
               "type": "activity",
               "activityType": "recovery",
               "progress": 74.4,
               "processed": 15600512,
               "total": 20954112,
               "finish": 3.2,
               "speed": 27496
            }
         ]
      }
   ]
}
```
This output generates a straight base to provide other applications useful information like server-state example [client-base](https://github.com/server-state/client-base).

This official module belongs to the organization [server-state](https://github.com/server-state).
npm package: @server-state/mysql-state-module
Description: A module for querying the MySQL state show by `SHOW status`
Author: server-state
Latest version: 0.1.6

# mysql-state-module

[![Build Status](https://travis-ci.com/server-state/mysql-state-module.svg?branch=master)](https://travis-ci.com/server-state/mysql-state-module)
![GitHub](https://img.shields.io/github/license/server-state/mysql-state-module)
[![npm version](https://badge.fury.io/js/%40server-state%2Fmysql-state-module.svg)](https://badge.fury.io/js/%40server-state%2Fmysql-state-module)
[![Coverage Status](https://coveralls.io/repos/github/server-state/mysql-state-module/badge.svg?branch=master)](https://coveralls.io/github/server-state/mysql-state-module?branch=master)
![module type: official](https://img.shields.io/badge/module%20type-official-%23015ba0)

A module for querying the state of a MySQL server. Its response will be a
key-value-pair object of the results of

```sql
SHOW status;
```

Numeric values will get represented as numbers, `'YES'` and `'ON'` as `true`,
`'NO'` and `'OFF'` as `false` and everything else as its raw stirng.

### Example
To use the module, you'll need to pass a configuartion object containing the connect information to the [*SMF*](https://github.com/server-state/specs/blob/master/terminology/server-module-function.md).

Since the module uses `mysql2`, which is *mostly API-compatible with `mysqljs/mysql`*, you may refer to https://github.com/mysqljs/mysql#connection-options for specifications. In most cases, though, you'll need to pass a `host`, a `user`, a `password` and possibly a `port`:

```js
serverState.registerModule('mysql-state', require('@server-state/mysql-state-module'), {
	host: 'localhost',
	user: 'my-username',
	password: 'somePassword'
});
```

This official module belongs to the organization [server-state](https://github.com/server-state).
npm package: @server-state/network-devices-overview-extension
Description: Add GraphQL query endpoints to examine the installed/detected network devices
Author: fliegwerk
Latest version: 0.3.2

# `@server-state/network-devices-overview-extension`

!["Built for Server State" badge](https://img.shields.io/badge/Built%20for-Server%20State-%23ffc107)
![npm (scoped)](https://img.shields.io/npm/v/@server-state/network-devices-overview-extension)

## Overview

Add GraphQL query endpoints to examine the installed/detected network devices

## Installation

This is intended to be installed on Server State servers.

Use the built-in functionalities to install this extension. For more details, please refer to the [Server State documentation](https://www.server-state.tech/docs/).

Alternatively, in your server, use `npm install @server-state/network-devices-overview-extension -w plugins` to manually install the extension.

## GraphQL Schema Extensions

<!--
This extension doesn't extend the Server State GraphQL schema.
-->

This extension extends the GraphQL schema. For technical details, please refer to [the schema extension definition](./src/schema.graphql).
npm package: @server-state/raw-module
Description: Module for raw exec output for the server-state project
Author: server-state
Latest version: 0.1.10

# raw-module

[![Build Status](https://travis-ci.com/server-state/raw-module.svg?branch=master)](https://travis-ci.com/server-state/raw-module)
![GitHub](https://img.shields.io/github/license/server-state/raw-module)
[![npm version](https://badge.fury.io/js/%40server-state%2Fraw-module.svg)](https://badge.fury.io/js/%40server-state%2Fraw-module)
[![Coverage Status](https://coveralls.io/repos/github/server-state/raw-module/badge.svg?branch=master)](https://coveralls.io/github/server-state/raw-module?branch=master)
![module type: official](https://img.shields.io/badge/module%20type-official-%23015ba0)

A module for the server-state project.
This module allows running "raw" terminal commands and getting their output to
stdout and stderr. Commands do **not** get run in chronological order and each
command may only get run once per *SM*.

### Example
As `options`, the `raw-module` *SMF* takes an array of commands (`string[]`)
that get executed:
```js
serverState.registerModule('raw', require('@server-state/raw-module'), [
    'ls',
    'whoami',
    'echo Hello'
]);
```

It then returns the outputs of these commands in a key-value-pair object where
the commands serve as keys (this is also the reason why duplicate commands
aren't allowed).

Example return object:
```json
{
    "ls":{"stdout":"[...]","stderr":"","cmd":"ls","code":0},
    "whoami":{"stdout":"[...]","stderr":"","cmd":"whoami","code":0},
    "echo Hello":{"stdout":"Hello","stderr":"","cmd":"echo Hello","code":0}
}
```
npm package: @server-state/server-base
Description: Server-side (NodeJS based) implementation of the architecture (no modules included)
Author: server-state
Latest version: 0.2.0

# server-base
[![Build Status](https://travis-ci.com/server-state/server-base.svg?branch=master)](https://travis-ci.com/server-state/server-base)
![GitHub](https://img.shields.io/github/license/server-state/server-base)
[![npm version](https://badge.fury.io/js/%40server-state%2Fserver-base.svg)](https://badge.fury.io/js/%40server-state%2Fserver-base)

Server-side (NodeJS based) implementation of the server-base architecture (no modules included).

It manages server modules and can get attached to an express app, where it creates routes under `/api/v1/`, as specified in https://github.com/server-state/specs/blob/master/api/routes.md.

### Example
```js
let app; // An express app

const ServerState = require('@server-state/server-base');

const server = new ServerState({
	logToConsole: true, // Log error messages to console, ...
	logToFile: false // ... but not to a file
});

// Add module under name 'raw'. Will add it to /api/v1/all and create /api/v1/raw
server.addModule('raw', require('@server-state/raw-module'), [
	'ls',
	'whoami'
]);

server.init(app); // Attach the server-state server to the express app

app.listen(8080); // "Start" the express app
```
npm package: @server-state/tablelike-table-cbm
Description: A table visualization of the table-like standard DF
Author: server-state
Latest version: 0.1.6
Deprecated: CBMs no longer get distributed via npm

# tablelike-table-cbm

A <abbr title="client-base module">CBM</abbr> for the [tablelike DF](https://github.com/server-state/specs/blob/master/arch/data-formats.md#tabletable-like) that provides a table visualization of said data structure.

It can get installed with

```shell script
yarn add @server-state/tablelike-table-cbm
```

and then registered in the *client-base*'s `component-registry.js` like this:

```js
import Table from '@server-state/tablelike-table-cbm'

const components = {
    [...],
    table: Table
}
```
npm package: @server-state/types
Description: Types for Server State and their projects
Author: server-state
Latest version: 0.5.0

# Server State TypeScript Definitions

npm: [`@server-state/types`](https://www.npmjs.com/package/@server-state/types)

[![GitHub](https://img.shields.io/github/license/server-state/types)](LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/server_state?style=social)](https://twitter.com/server_state)

Standard TypeScript definitions for use in Server State projects.

## Installation

First, add it as a development dependency to your project:

```shell
npm install --save-dev @server-state/types
```

After the installation, check out the provided types:

```ts
import { Extension } from '@server-state/types';

const myExtension: Extension<MyConfig> = (config, api) => {
	//...
	return {
		name: 'MyExtension'
	};
};
```

You can also, optionally, add the package to your `tsconfig.json`'s `compilerOptions.typeRoots` array to get access to the most common types via the global `ServerStateTypes` namespace:

```json5
// tsconfig.json
{
	compilerOptions: {
		typeRoots: [
			'node_modules/@server-state/types',
			'node_modules/@types'
			// [...]
		]
		// [...]
	}
	// [...]
}
```

```ts
// some TypeScript source file

let a: ServerStateTypes.JsonSerializable;
```

Namespace access is handy when you write in JavaScript and don't want to use `import('@server-state/types')` everywhere in your JSDoc comments:

```js
// some JavaScript source file

/**
 * @type {ServerStateTypes.JsonSerializable}
 */
let a;

// instead of

/**
 * @type {import('@server-state/types').JsonSerializable}
 */
let b;
```

For all complete list of types, check out the reference:
[types.server-state.tech](https://types.server-state.tech/)

## Package structure

```
.
├── sample (samples for the types, useful for testing the types)
│   ├── sample.ts
│   ├── sample-js.js
│   └── tsconfig.json
├── src
│   ├── index.ts
│   └── [...]
├── types (built-in build script)
│   ├── index.d.ts
│   └── [...]
├── CHANGELOG.md (DO NOT TOUCH! auto-generated changelog for the package)
├── LICENSE
├── package.json
├── README.md (you're here :P)
└── [...] (configuration files)
```

## Contributing

Coming soon :wink:

## Contributors

Thank you to all contributors of this repository:

[![Contributors](https://contrib.rocks/image?repo=server-state/types)](https://github.com/server-state/types/graphs/contributors)

Made with [contributors-img](https://contrib.rocks).

## About

This repository is part of [Server State](https://www.server-state.tech/), a project by [fliegwerk](https://www.fliegwerk.com/).
npm package: @server-state/ufw-status-module
Description: A module for querying the status of a UFW firewall (requires sudo privileges)
Author: server-state
Latest version: 0.1.6

# ufw-status-module
|Info|Value|
|---|---|
|Repository|https://github.com/server-state/ufw-status-module|
|NPM Package|[`@server-state/ufw-status-module`](https://www.npmjs.com/package/@server-state/ufw-status-module)|
|Package version|[![npm version](https://badge.fury.io/js/%40server-state%2Fufw-status-module.svg)](https://www.npmjs.com/package/@server-state/ufw-status-module)|
|CI Build|[![Build Status](https://travis-ci.com/server-state/ufw-status-module.svg?branch=master)](https://travis-ci.com/server-state/ufw-status-module)|
|Issues|[GitHub Issues](https://github.com/server-state/ufw-status-module/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)|

## Abstract
A module for querying the status of a UFW firewall (requires sudo privileges)

This official [*Server State Server Module*](https://specs.server-state.tech/#/terminology/server-module) belongs to the organization [Server State](https://github.com/server-state).

### Setup
To successfully use this module, you'll need to grant the user executing the command (here, we'll call him `nodeUser`)
sudo (or root) execution rights for the command `ufw status`. To do this, please add the following `server-state-ufw-status-module` file to
`/etc/sudoers.d/`:

```
nodeUser ALL=(ALL) NOPASSWD: /usr/bin/ufw status
```


## Input
### Type
```typescript
undefined
```

### Description
No input is needed for this module

## Output
This is using

- [x] A standard data format as defined in [Data Formats](/arch/data-formats.md)
- [x] A custom data format described below

### Custom data format specifications
Type: [`TableData`](https://types.server-state.tech/modules/serverstate.dataformats.html#tabledata) -compatible

```ts
{  
    type: 'ufw-status',
    status: 'active' | 'inactive',
    _fields: string[],
    rows: Array<{
        [_field: string]: string | number | boolean
    }>
}
```

### Specifications about the information in the return variable
n/a

### Exceptions (if applicable)
#### `sudo ufw status` returned with an exit code other than `0`
If `sudo ufw status` returns with an exit code other than `0`, an Error containing the `stderr` output in its message gets thrown.

## Performance
The module performs the tasks in a runtime-complexity of

_O(n)_

where _n_ is the number of rules in the status (i.e., here, table rows).
npm package: @server-status/api-plugin-apache2
Description: information about running vhosts via apache2
Author: Adam Zielonka
Latest version: 0.0.6
Deprecated: The plugin has been moved to the main project (@server-status/api).

# Apache2 plugin for Server Status API

GraphQL API for retrieving information about running virtual host via apache2.

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-apache2
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-apache2
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-apache2',
      // config: {
      //   user: 'username',
      //   pass: 'password',
      // }
    },
  ],
}

ServerStatus(config).listen()

```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/api-plugin-auth
Description: auth plugin for server-status
Author: Adam Zielonka
Latest version: 0.0.8
Deprecated: The plugin has been moved to the main project (@server-status/api).

# Authorization plugin for Server Status API

GraphQL API for simple authorization to server-status

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-auth
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-auth
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-auth',
      config: {
        users: [
          {
            name: 'dragon',
            pass: 'dragon',
          }
        ],
        secret: 'pancake-is-the-best-dragon',
      }
    },
  ],
}

ServerStatus(config).listen()

```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/api-plugin-caddy
Description: information about running vhosts via caddy server
Author: Adam Zielonka
Latest version: 0.0.5
Deprecated: The plugin has been moved to the main project (@server-status/api).

# Caddy Server plugin for Server Status API

GraphQL API for retrieving information about running virtual host via [Caddy Server](https://caddyserver.com/).

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-caddy
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-caddy
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-caddy',
      // config: {
      //   user: 'username',
      //   pass: 'password',
      //   port: 2019,
      // }
    },
  ],
}

ServerStatus(config).listen()

```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/api-plugin-pm2
Description: information about running apps via pm2
Author: Adam Zielonka
Latest version: 0.0.2
Deprecated: The plugin has been moved to the main project (@server-status/api).

# PM2 plugin for Server Status API

GraphQL API for retrieving information about running app via [PM2](https://pm2.io/).

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-pm2
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-pm2
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-pm2',
    },
  ],
}

ServerStatus(config).listen()

```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/api-plugin-services
Description: information about selected services
Author: Adam Zielonka
Latest version: 0.0.3
Deprecated: The plugin has been moved to the main project (@server-status/api).

# Services plugin for Server Status API

GraphQL API for retrieving information about running services.

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-services
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-services
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-services',
      config: {
        services: [
          {
            name: 'ServerStatus',
            port: '4000',
          },
          {
            name: 'OneTwoThere',
            port: '123',
          },
        ],
        hosts: [
          'localhost'
        ]
      }
    },
  ],
}

ServerStatus(config).listen()

```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/api-plugin-systeminformation
Description: plugin for server-status for retrieving server status information
Author: Adam Zielonka
Latest version: 0.0.12
Deprecated: The plugin has been moved to the main project (@server-status/api).

# System Information plugin for Server Status API

GraphQL API for retrieving server system information from package [systeminformation](https://systeminformation.io/).  
Work in progress. Only small part of systeminformation package had been rewritten.

## Use

It is plugin so you need use the [`@server-status/api`](https://www.npmjs.com/package/@server-status/api) or you can adapt to yours [ApolloServer](https://www.apollographql.com/docs/apollo-server/). But if you choose my solution you need to do this steps: 

```bash
$ npm install @server-status/api @server-status/api-plugin-systeminformation
```
or
```bash
$ yarn add @server-status/api @server-status/api-plugin-systeminformation
```

Create file e.g. `index.js`
```js
const ServerStatus = require('@server-status/api')

const config = {
  plugins: [
    {
      name: '@server-status/api-plugin-systeminformation',
    },
  ],
}

ServerStatus(config).listen()
```
And run server
```bash
$ node index.js
```

## Licence

MIT
npm package: @server-status/app
Description: app for presentation server status information
Author: Adam Zielonka
Latest version: 0.2.0

# Server Status App

Frontend app for [`@server-status/api`](https://gitlab.com/server-status/server-status-api)

![](img/server-status.png)

## Build

Default endpoint is '/api/', if you want to use different use env `REACT_APP_API_URL`.
You can use in `.env` file:
```env
REACT_APP_API_URL=https://server.example.com/api/
```
Or you can use in terminal:
```bash
$ REACT_APP_API_URL=https://server.example.com/api/ yarn build
```

## License
MIT
npm package: @server/esm
Description: A server.js plugin to automatically bundle front-end Javascript. Just require /script.js or /script.min.js from the front-end
Author: Francisco Presencia
Latest version: 0.1.0

# @server/esm

A server.js plugin to automatically bundle front-end Javascript with [server.js](https://serverjs.io/). You request `/script.js` or `/script.min.js` and this plugin will make sure to either compile it on each request for dev, or once on launch for production.

> This is **beta software** right now.

## Getting Started

First install the plugin:

```
npm install @server/esm
```

Then in your main `index.js` include it with server.js:

```js
const server = require("server");
const serverEsm = require("@server/esm");

// TEMPORARY; this line will change
server.plugins.push(serverEsm);

const { get } = server.router;
const { render } = server.reply;

// Render a single route for the homepage
server(get("/", () => render("index.html")));
```

Then let's create this file. This will be a simple HTML file inside `views/index.html`:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>ESM Demo</title>
  </head>
  <body>
    <h1>Hi there</h1>
    <script src="/script.js" charset="utf-8"></script>
  </body>
</html>
```

The main important part here is the `/script.js`. This will be automatically compiled and generated from `@server/esm`. Finally, let's create some javascript:

```js
// scripts/index.js
import add from "./add.js";
document.querySelector("h1").innerHTML = `1 + 2 = ${add(1, 2)}`;
```

```js
// scripts/add.js
export default (a, b) => a + b;
```

Finally start the server with `node .` and try the project by opening `http://localhost:3000/`!

## Options

The only option available is the `source` of the JS, which can be specified as one of either:

```js
// With the default path:
server({ esm: "scripts/index.js" });
server({ esm: { source: "scripts/index.js" } });

// But it can be anything really:
server({ esm: "src/index.js" });
server({ esm: "src/myscript.js" });
```

The extension can be either `.js` or `.mjs`, both will work properly.

The behaviour is a bit different for development and production, but from the front-end point of view you want to just request `/style.css` or `/style.min.css` (depending on your preferences).

## Demo

Clone this repo:

```js
git clone git@github.com:franciscop/server-esm.git
cd server-esm
```

Then install the dependencies, enter `demo` and start the project:

```bash
npm install
cd demo
node .
```

Finally open `http://localhost:3000/` to see the styles being rendered.
npm package: @server/react
Description: A plugin for loading React with server
Author: Francisco Presencia
Latest version: 0.1.3

# React for server.js

> **Highly experimental plugin** for [server.js](https://serverjs.io/):

Renders React both server-side and browser-side by using next underneath. Write React for managing your views and make your website faster as a SPA.


## Install

```bash
npm install server @server/react
```

## Usage

First thing in your `index.js` file:

```js
const server = require('server');
server.plugins.push(require('@server/react'));

server(...);
```

Then you can add routes to it. See the example from this project's repository in the `index.js`:

```js
const server = require('server');
server.plugins.push(require('@server/react'));
const { get } = server.router;
const { render } = server.reply;

// Will automatically serve this and any page in 'pages'
server(
  get('/b/:subreddit', ctx => render('handler.js')),
);
```

Each page that you create under the `pages` folder will be automatically linked, and here we are also handling any subreddit manually with `handler.js`.

## Pages examples

For our main page, `pages/index.js`:

```js
// pages/index.js
import React from 'react';
import Link from 'next/link';

import Nav from './Nav.js';

export default props => (
  <main>
    <Nav>Main page</Nav>
    <h1>Hello {props.user}</h1>
    <p>I am working quite nicely</p>
    <Link href="/about">About me</Link>
  </main>
);
```

For more information about us:

```js
import React from 'react';

import Link from 'next/link';
import Head from 'next/head';

export default class About extends React.Component {
  static async getInitialProps ({ req }) {
    return {
      server: !!req
    };
  }
  render () {
    return (
      <div>
        <style jsx>{`button { background: red; }`}</style>
        <Head>
          <title>Hello {this.props.server ? 'server' : 'client'}</title>
        </Head>
        Hi {this.props.server ? 'server' : 'client'}
        <Link href="/">
          <button>Homepage</button>
        </Link>
      </div>
    );
  }
}
```

For dynamic routes in `pages/handler.js`:

```js
import React from 'react';
import Nav from './Nav.js';

export default props => (
  <div>
    <Nav>Sub!</Nav>
    <p>Subpage {props.url.query.subreddit}</p>
  </div>
);
```
npm package: @server/sass
Description: Automatically compile SASS to CSS for your server.js project
Author: Francisco Presencia
Latest version: 0.3.0

# @server/sass

A small plugin to automatically handle SASS and SCSS with [server.js](https://serverjs.io/). You request `/style.css` or `/style.min.css` and this plugin will make sure to either compile it on each request for dev, or once on launch for production.

> THIS IS WORKING BUT **EXPERIMENTAL** right now.

## Getting Started

First install the plugin:

```
npm install @server/sass
```

Then in your main `index.js` include it with server.js:

```js
const server = require("server");
const serverSass = require("@server/sass");

// TEMPORARY; this line will change
server.plugins.push(serverSass);

const { get } = server.router;
const { render } = server.reply;

// Render a single route for the homepage
server(get("/", () => render("index.html")));
```

Then let's create this file. This will be a simple HTML file inside `views/index.html`:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Sass Demo</title>
    <link rel="stylesheet" href="/style.css" />
  </head>
  <body>
    <h1>Hi there</h1>
    <div>Hello world!</div>
  </body>
</html>
```

The main important part here is the `/style.css`. This will be automatically compiled and generated from `@server/sass`. Finally, let's create some style on `style/style.scss`:

```scss
$background: red;

body {
  div {
    background: $background;
  }
}

ul li:nth-child(3) {
  background: $background;
}
```

Finally start the server with `node .` and try the project by opening `http://localhost:3000/`!

## Options

The only option available is the `source` of the SASS/SCSS, which can be specified as one of either:

```js
// With the default path:
server({ sass: "style/style.scss" });
server({ sass: { source: "style/style.scss" } });

// But it can be anything really:
server({ sass: "style.scss" });
server({ sass: "sass/style.sass" });
```

The extension can be either `.scss` or `.sass`, both will work properly.

The behaviour is a bit different for development and production, but from the front-end point of view you want to just request `/style.css` or `/style.min.css` (depending on your preferences).

## Demo

Clone this repo:

```js
git clone git@github.com:franciscop/server-sass.git
cd server-sass
```

Then install the dependencies, enter `demo` and start the project:

```bash
npm install
cd demo
node .
```

Finally open `http://localhost:3000/` to see the styles being rendered.