
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
Interact with the Piston API using this lightweight JavaScript/TypeScript wrapper.
Using npm:
npm install njp-piston
To use the Piston library, follow the below steps:
piston method:import { piston } from 'njp-piston';
const pistonInstance = await piston("http://localhost:2000");
console.log(pistonInstance.configuration);
const runtimes = await pistonInstance.getRuntimes();
console.log(runtimes);
In this example, we're executing a Python code that reads an input and prints a greeting:
const result = await pistonInstance.executeSourceCode(
"r = input()\nprint('Hello ' + r)",
"python",
"World!"
);
console.log(result);
Here's a complete example putting it all together:
import { piston } from 'njp-piston';
(async () => {
const pistonInstance = await piston("http://localhost:2000");
console.log(pistonInstance.configuration);
console.log(await pistonInstance.getRuntimes());
console.log(await pistonInstance.executeSourceCode("r = input()\nprint('Hello ' + r)", "python", "World!"));
})();
Further API documentation can be found at the piston website https://piston.readthedocs.io/en/latest/api-v2/.
This library is released under the MIT License.
FAQs
A simple node.js wrapper for the Piston API that works well with types.
The npm package njp-piston receives a total of 2 weekly downloads. As such, njp-piston popularity was classified as not popular.
We found that njp-piston demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.