v0.1.16 - Now with HMR support

Write Python,
Ship JavaScript

JPS is a Python-like language that compiles to clean, readable JavaScript. Seamlessly integrates with React, Vue, Svelte, and any frontend framework.

JPS

JPS

New Programming Language | Write Python-like in Javascript

Check it out on Product Hunt →
JPS - New Programming Language |  Write Python-like in Javascript | Product Hunt
🐍 JPS Input
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)

class Calculator:
    def __init__(self):
        self.history = []

    def add(self, a, b):
        result = a + b
        self.history.append(result)
        return result

print(fibonacci(10))
JS JavaScript Output
function fibonacci(n) {
  if (n <= 1) {
    return n;
  }
  return fibonacci(n - 1) + fibonacci(n - 2);
}

class Calculator {
  constructor() {
    this.history = [];
  }

  add(a, b) {
    const result = a + b;
    this.history.push(result);
    return result;
  }
}

console.log(fibonacci(10));

Everything you need to build

A complete toolset for writing Python-like code that runs anywhere JavaScript runs.

🐍

Python-like Syntax

Write code using familiar Python syntax - functions, classes, list comprehensions, and more. No learning curve for Python developers.

Standalone File Integration

Import .jps files directly like .tsx files! Works with Vite, Webpack, and other bundlers with zero configuration.

🔥

Hot Module Replacement

Instant feedback during development. Changes to your JPS files are reflected immediately without page reload.

📦

Multiple Output Formats

Output as ESM, CommonJS, IIFE, or UMD. Perfect for modern apps, Node.js, browsers, or universal libraries.

🔧

Build Tool Plugins

First-class plugins for Vite, Webpack, Rollup, and esbuild. Seamless integration with your existing workflow.

🌐

Browser Ready

Works directly in the browser without any build step. Load from CDN and start coding immediately.

Familiar and intuitive

If you know Python, you already know JPS. Clean, readable syntax that compiles to clean JavaScript.

📝 Variables & Types
# Dynamic typing
x = 10
name = "JPS"
is_valid = true
items = [1, 2, 3]
data = {"key": "value"}
⚙️ Functions
def greet(name, greeting="Hello"):
    return greeting + ", " + name

# Lambda expressions
square = lambda x: x * x

print(greet("World"))
🏛️ Classes
class Animal:
    def __init__(self, name):
        self.name = name

class Dog(Animal):
    def bark(self):
        print("Woof!")

dog = Dog("Rex")
🔀 Control Flow
if x > 5:
    print("Big")
else:
    print("Small")

for i in range(5):
    print(i)

while count > 0:
    count = count - 1
📤 Modules
# lib.jps
export def helper():
    return "Help!"

# main.jps
from lib import helper

result = helper()
🧰 Standard Library
print("Hello!")
len([1, 2, 3])       # 3
range(0, 10, 2)      # [0,2,4,6,8]
sum([1, 2, 3])       # 6
map(lambda x: x*2, [1,2])

Built-in functions

Python-like built-in functions available out of the box.

I/O
print(*args) - Output to console
Math
sum(list) - Sum of elements
min(list) - Minimum value
max(list) - Maximum value
Functional
map(fn, list) - Apply function
filter(fn, list) - Filter elements
sorted(list) - Sorted copy
Utilities
len(obj) - Get length
range(start, end, step) - Number sequence
str(x), int(x), float(x) - Type conversion

Try it yourself

Write JPS code and see it compile to JavaScript in real-time.

🎮 Interactive Playground
JPS Code
Output
Click "Run" to execute your code...

Works with your stack

Seamless integration with all major frameworks and build tools.

Simple and powerful

A clean API for programmatic compilation.

compile(source, options?): CompileResult

Compiles JPS source code to JavaScript with full metadata and options.

Parameters
source string JPS source code to compile
options.format 'esm' | 'cjs' | 'iife' | 'umd' Output format (default: 'esm')
options.runtimeMode 'inline' | 'external' | 'cdn' | 'none' Runtime handling (default: 'external')
import { compile } from 'jpsx';

const result = compile(`
def add(a, b):
    return a + b
`, {
  format: 'esm',
  runtimeMode: 'inline'
});

console.log(result.code);
compileToJS(source, options?): string

Simplified API that returns only the JavaScript code string.

import { compileToJS } from 'jpsx';

const jsCode = compileToJS('print("Hello!")');
console.log(jsCode);
getRuntime(): string

Returns the JPS runtime library code. Useful for custom bundling or extending the runtime.

import { getRuntime } from 'jpsx';

const runtime = getRuntime();
// Includes: print, range, sum, len, map, filter, etc.

Install in seconds

Choose the installation method that works best for your project.

Install globally (CLI)
npm install -g jpsx
Install as a dependency
npm install jpsx
Use via CDN (no install required)
import { compile } from 'https://cdn.jsdelivr.net/npm/jpsx@latest/dist/api/index.js'
Create a new project
jpsx init my-project && cd my-project && jpsx run main.jps