This package has been deprecated
Author message:
Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
var-server
1.0.2 • Public • Published 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 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)
})
Package Sidebar
Install
Weekly Downloads