New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eval-slave

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eval-slave

Slave stdio node js evaluator

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

eval-slave

Dead simple node.js evaluator controlled via standart input

Install

With npm do:

npm install eval-slave

Or install globally if you want to add the node-eval-slave executable:

npm install -g eval-slave

Usage

Check out the https://github.com/futpib/eval-slave/tree/master/examples dir

Abstract

  1. Start node-eval-slave or node ./cli.js
  2. Write JSON array of "tasks" to the process's standard input
  3. Results will be printed as a JSON array to the standard output

You can even try it from shell!

Bash

echo '[{"source":"() => \"test\""}]' | node-eval-slave

Python

See https://github.com/futpib/eval-slave/tree/master/examples/foo.py

Emacs Lisp

(probably) Coming soon at https://github.com/futpib/emacs-nodejs-slave

Example

input (js, because real json is a bit too hairy):

[{
  id: 0,
  source: (function (input) {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve(`Hello, ${input}`)
      }, 1000)
    })
  }).toString(),
  arguments: ["world"]
}, {
  id: 1,
  source: "() => \"foobar\"",
}]

output (json):

[{
  "type": "queued",
  "data": {
    "id": 0
  }
}, {
  "type": "queued",
  "data": {
    "id": 1
  }
}, {
  "type": "fulfilled",
  "data": {
    "id": 1,
    "value": "foobar"
  }
}, {
  "type": "fulfilled",
  "data": {
    "id": 0,
    "value": "Hello, world"
  }
}]

FAQs

Package last updated on 07 May 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc