An open API service indexing awesome lists of open source software.

https://github.com/yisar/pek

Tiny JavaScript Compiler
https://github.com/yisar/pek

resumable server-side-rendering ssr

Last synced: 7 months ago
JSON representation

Tiny JavaScript Compiler

Awesome Lists containing this project

README

          

# Pek
> Tiny Javascript compiler

- Simplest bundler algorithm
- Smallest JavaScript compiler

input

```js
import { hello } from './hello.js'

function world() {
return 'World'
}

console.log(hello)
console.log(world())
```

output

```js
(function (global) {
const P$hello_js$hello = 'hello';

const P$index_js$world = () => console.log("world");

console.log(P$hello_js$hello);
console.log(P$index_js$world());
})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
```