New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

codexe

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codexe

A secure, Docker-based remote code execution engine for Node.js supporting Python, C++, Java, and JS.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

🚀 Codexe — Code Execution Engine

Codexe is a secure, lightweight, multi-language remote code execution (RCE) engine for Node.js.
It uses isolated Docker containers to safely run untrusted user code.

Perfect for building:

  • Online Judges
  • Skill Assessment Platforms
  • Hackathon Portals
  • Learning Management Systems (LMS)

✨ Features

  • Multi-Language Support: Python 3, C, C++, Java 17, JavaScript (Node.js)
  • Secure by Default: Runs in ephemeral Docker containers with --network none
  • Cross-Platform: Works on Windows, WSL2, Linux, and macOS
  • Auto-Cleanup: Removes temp files and containers automatically
  • Zero Config: Handles compilation and execution seamlessly

📦 Installation

npm install codexe

Using scoped version:

npm install @pratik-patil-369/codexe

⚠️ Prerequisites

  • Docker Desktop or Docker Engine (running)
  • Node.js v16+

🛠️ Usage

const { executeCode } = require('codexe');

async function run() {
    // 1. Execute Python
    console.log("Running Python...");
    const pythonResult = await executeCode(
        'python',
        'print(f"Hello {input()}!")',
        'World' // stdin
    );
    console.log(pythonResult);
    // Output: { status: 'Success', output: 'Hello World!' }

    // 2. Execute C++
    console.log("Running C++...");
    const cppCode = `
    #include <iostream>
    int main() {
        int x;
        std::cin >> x;
        std::cout << "Square is: " << x * x;
        return 0;
    }
    `;
    const cppResult = await executeCode('cpp', cppCode, '5');
    console.log(cppResult);
    // Output: { status: 'Success', output: 'Square is: 25' }
}

run();

🌍 Supported Languages

IdentifierLanguageDocker Image
pythonPython 3python:3.9-alpine
javascriptNode.jsnode:18-alpine
cppC++ (GCC)gcc:latest
cC (GCC)gcc:latest
javaJava 17eclipse-temurin:17-jdk-alpine

🏗️ Architecture & Security

Codexe uses a Docker-per-request model:

  • Fresh Container per Execution
  • 128MB RAM Limit
  • Network Disabled
  • Read-Only System Paths
  • Immediate Container Cleanup

🤝 Contributing

Contributions are welcome! Want to add Rust, Go, or enhanced sandboxing? Open an issue or submit a PR.

Keywords

codexe

FAQs

Package last updated on 08 Mar 2026

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