Socket
Book a DemoInstallSign in
Socket

node-calls-python

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-calls-python - npm Package Compare versions

Comparing version

to
1.7.7

4

index.d.ts
export class PyModule
{
private _type: 'PyModule';
private constructor() {}
private constructor();
}

@@ -10,3 +10,3 @@

private _type: 'PyObject';
private constructor() {}
private constructor();
}

@@ -13,0 +13,0 @@

{
"name": "node-calls-python",
"version": "1.7.6",
"version": "1.7.7",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "This module lets you run python code inside node without spawning new processes",

![node-calls-python](https://github.com/hmenyus/node-calls-python/blob/master/logo.png)
# node-calls-python - call Python from NodeJS directly in-process without spawning processes
# node-calls-python - call Python from Node.js directly in-process without spawning processes

@@ -10,2 +10,9 @@ ## Suitable for running your ML or deep learning models from Node directly

## Motivation
Current solutions spawn a new process whenever you want to run Python code in Node.js and communicate via IPC using sockets, stdin/stdout, etc.
But creating new processes every time you want to run Python code could be a major overhead and can lead to significant performance penalties.
If the execution time of your Python code is less than creating a new process, you will see significant performance problems because your Node.js code will keep creating new processes instead of executing your Python code.
Suppose you have a few NumPy calls in Python: do you want to create a new process for that? I guess your answer is no.
In this case, running the Python code in-process is a much better solution because using the embedded Python interpreter is much faster than creating new processes and does not require any IPC to pass the data around. The data can stay in memory and requires only some conversions between Python and Node types (using the N-API and Python C API).
## Installation

@@ -47,3 +54,3 @@ ```

### **Mac**: install XCode from AppStore, [NodeJS](https://nodejs.org/en/download/) and [Python](https://www.python.org/downloads/)
### **Mac**: install XCode from AppStore, [Node.js](https://nodejs.org/en/download/) and [Python](https://www.python.org/downloads/)
```

@@ -50,0 +57,0 @@ npm install node-calls-python

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.