New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

var-server

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

var-server

local server to access variables for tests

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

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

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

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.

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

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

Keywords

variables

FAQs

Package last updated on 16 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts