Skip to content

robojones/var-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published