All Projects → paij0se → api-deno-compiler

paij0se / api-deno-compiler

Licence: other
This is an api that execute your deno code and send you the output

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to api-deno-compiler

dem
A module version manager for Deno.
Stars: ✭ 58 (+346.15%)
Mutual labels:  deno
deno install
Deno 安装器(国内加速)
Stars: ✭ 58 (+346.15%)
Mutual labels:  deno
erc20-balance
💎 Get 2000+ ERC-20 token balances with JavaScript. Supports Node.js and Deno
Stars: ✭ 18 (+38.46%)
Mutual labels:  deno
rippledb
Embeddable key-value database engine in pure TypeScript, based on LSM-Tree
Stars: ✭ 33 (+153.85%)
Mutual labels:  deno
i18next-http-backend
i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
Stars: ✭ 270 (+1976.92%)
Mutual labels:  deno
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (+38.46%)
Mutual labels:  deno
deno-csv
Streaming API for reading and writing CSV for https://deno.land/
Stars: ✭ 34 (+161.54%)
Mutual labels:  deno
swagger2ts
💗 从 Swagger 生成优雅的 Typescript 代码. Generate elegant typescript code from swagger.
Stars: ✭ 17 (+30.77%)
Mutual labels:  deno
deno-task-runner
Task runner for deno
Stars: ✭ 31 (+138.46%)
Mutual labels:  deno
denoffi
Deno Foreign Function Interface.
Stars: ✭ 37 (+184.62%)
Mutual labels:  deno
logrocket deno api
A functional CRUD-like API with Deno and Postgres
Stars: ✭ 23 (+76.92%)
Mutual labels:  deno
database
towards a common interface for SQL databases in Deno TypeScript
Stars: ✭ 15 (+15.38%)
Mutual labels:  deno
vscode-deno-extensionpack
Deno VS Code Extension Pack
Stars: ✭ 12 (-7.69%)
Mutual labels:  deno
iam-policies
Iam policies implementation for create roles and manage permissions
Stars: ✭ 20 (+53.85%)
Mutual labels:  deno
deno bindgen
Simplified glue code generation for Deno FFI libraries written in Rust.
Stars: ✭ 142 (+992.31%)
Mutual labels:  deno
hex
An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Stars: ✭ 48 (+269.23%)
Mutual labels:  deno
merlin
Testing and Benchmarking framework for deno 🧙‍♂️
Stars: ✭ 46 (+253.85%)
Mutual labels:  deno
event
📆 Strictly typed event emitter with asynciterator support
Stars: ✭ 30 (+130.77%)
Mutual labels:  deno
espresso
Minimal web framework for Deno
Stars: ✭ 43 (+230.77%)
Mutual labels:  deno
progress
ProgressBar in terminal for deno
Stars: ✭ 39 (+200%)
Mutual labels:  deno

this a simple api that execute your deno code and send you the output, has not limit per request

example request:

in deno:

const rawResponse = await fetch(
  "https://api-deno-compiler.herokuapp.com/code",
  {
    method: "POST",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      code: `console.log(await fetch("https://api-deno-compiler.herokuapp.com/code"))`,
    }),
  }
);
const content = await rawResponse.json();
console.log(content);

other example with deno, with more requests:

const code = [
  `console.log("hello world")`,
  `console.log(Deno.version)`,
  `console.log("🍱 🦕")`,
  `for(let i=0;i<10;i++){console.log("number:",i)}`,
  `this would have an error`,
];

for (let i = 0; i < 10; i++) {
  const rawResponse = await fetch(
    "https://api-deno-compiler.herokuapp.com/code",
    {
      method: "POST",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        code: `${code[Math.floor(Math.random() * code.length)]}`,
      }),
    },
  );
  const content = await rawResponse.json();
  console.log(content);
}

in python:

import requests

code = """
console.log(Deno.memoryUsage()
"""

r = requests.post("https://api-deno-compiler.herokuapp.com/code",
                  json={"code": code})
print(r.text)

in go:

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"time"
)

func main() {
	start := time.Now()
	postBody, _ := json.Marshal(map[string]string{
		"code": "console.log(Deno.version)",
	})
	responseBody := bytes.NewBuffer(postBody)
	resp, err := http.Post("https://api-deno-compiler.herokuapp.com/code", "application/json", responseBody)
	if err != nil {
		log.Fatalf("An Error Occured %v", err)
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalln(err)
	}
	sb := string(body)
	fmt.Printf(sb)
	duration := time.Since(start)

	fmt.Printf("API Response Time: %d%s\n", duration.Milliseconds(), "ms")
}

Used in:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].