# var-server

> local server to access variables for tests

Latest version **1.0.2** (published 2017-02-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install var-server
pnpm add var-server
yarn add var-server
bun add var-server
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-02-16 |
| First published | 2017-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | robojones |
| Maintainers | robojones |
| Keywords | variables, remote, access, server, test |

## Links

- npm: https://www.npmjs.com/package/var-server
- Repository: https://github.com/robojones/var-server
- Homepage: https://github.com/robojones/var-server#readme
- Issues: https://github.com/robojones/var-server/issues
- npm.io page: https://npm.io/package/var-server

## Dependencies (1)

- [circular-json](https://npm.io/package/circular-json.md) ^0.3.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-02-16
- 1.0.1 — 2017-02-16
- 1.0.0 — 2017-02-14

## README

# var-server

This module provides you with a simple server http server.
It can be used to write tests e.g. for worker processes in a cluster.

## In the worker process

```javascript
require('var-server')(8080).listen()
```

__Note:__ The server listens on `127.0.0.1`, so it is only accessible on the same computer.

## In the test file

```javascript
const s = require('var-server')(8080)

s.run('process.argv').then(argv => {
  console.log(argv) // the argv from the test process
})
```

The code in the .get() method gets executed with `eval()` in the worker process.

```javascript
const s = require('var-server')(8080)

s.run('process.cwd()').then(cwd => {
  console.log(cwd)
})
```

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