bexy
v0.1.1
Published
JavaScript sandbox for safely executing code in isolated environments
Downloads
7
Maintainers
Readme
Bexy (formerly JSBox)
A secure JavaScript sandbox for safely executing untrusted code in isolated environments.
PyLama Ecosystem Navigation
| Project | Description | Links | |---------|-------------|-------| | Bexy | JavaScript sandbox for executing code | GitHub · NPM · Docs | | GetLLM | LLM model management and code generation | GitHub · PyPI · Docs | | DevLama | Python code generation with Ollama | GitHub · Docs | | LogLama | Centralized logging and environment management | GitHub · PyPI · Docs | | APILama | API service for code generation | GitHub · Docs | | BEXY | Sandbox for executing generated code | GitHub · Docs | | JSLama | JavaScript code generation | GitHub · NPM · Docs | | SheLLama | Shell command generation | GitHub · PyPI · Docs | | WebLama | Web application generation | GitHub · Docs |
Author
Tom Sapletta — DevOps Engineer & Systems Architect
- 💻 15+ years in DevOps, Software Development, and Systems Architecture
- 🏢 Founder & CEO at Telemonit (Portigen - edge computing power solutions)
- 🌍 Based in Germany | Open to remote collaboration
- 📚 Passionate about edge computing, hypermodularization, and automated SDLC
Support This Project
If you find this project useful, please consider supporting it:
Installation
npm install bexyQuick Start
Command Line Usage
# Run a JavaScript file in the sandbox
bexy run script.js
# Start an interactive REPL in the sandbox
bexy repl
# Show version
bexy --versionProgrammatic Usage
const { executeInSandbox } = require('bexy');
// Execute code in a secure sandbox
const result = await executeInSandbox('1 + 1');
console.log(result); // 2Features
- Secure code execution in isolated environments
- Support for both synchronous and asynchronous code
- Configurable resource limits (CPU, memory, execution time)
- Built-in REPL for interactive development
- Support for CommonJS and ES modules
- TypeScript type definitions included
Testing
To run tests for JSBox using the PyLama ecosystem:
cd ../../tests
./run_all_tests.sh
# or for a tolerant run
./run_all_tests_tolerant.shOr, from the jsbox directory:
make testProject Management
Common Makefile commands:
make install– Install dependenciesmake lint– Lint codemake test– Run testsmake build– Build projectmake clean– Clean build/depsmake format– Format codemake start– Start project (if supported)
Example: Creating a Safe JavaScript Sandbox
const JSBox = require('jsbox');
const userCode = '2 + 2';
const result = JSBox.evaluate(userCode);
console.log(result); // 4JSBox is a JavaScript sandbox for safely executing code in isolated environments. It is part of the PyLama ecosystem and integrates with LogLama as the primary service for centralized logging and environment management.
