0.0.1 • Published 2 years ago

typecc v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

typecc

Super simple TypeScript to C compiler.

Example

input.ts

import { printf } from "stdio.h";

function main(): number {
    printf("Hello World!");
    return 0;
}

compile.js

const typecc = require("typecc");
const fs = require("fs");

const input = fs.readFileSync("./input.ts", { encoding: "utf-8" });
const output = typecc.compile(input);

fs.writeFileSync("./output.c", output);

Generated output file: output.c

#include<stdio.h>
int main() {
printf("Hello World!");
return 0;
}