Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fries-byte/go.js
⚙️⌨️ Go.js is a tool for Go written in TypeScript, Go.js is a quick and simple way to code Go with simple words
https://github.com/fries-byte/go.js
code go javascript main quickstart typescript
Last synced: 3 days ago
JSON representation
⚙️⌨️ Go.js is a tool for Go written in TypeScript, Go.js is a quick and simple way to code Go with simple words
- Host: GitHub
- URL: https://github.com/fries-byte/go.js
- Owner: Fries-byte
- Created: 2025-01-06T08:55:24.000Z (3 days ago)
- Default Branch: main
- Last Pushed: 2025-01-06T08:56:16.000Z (3 days ago)
- Last Synced: 2025-01-06T09:43:26.867Z (3 days ago)
- Topics: code, go, javascript, main, quickstart, typescript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Easy to write, Fast Performance](https://github.com/user-attachments/assets/1be46de0-f76e-40b4-8e9b-7bf7a10eb161)
[![Download zip](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white "Download Zip")](https://github.com/sebastian-sestaliuc/Go.js/releases/tag/v1)
[![Download zip](https://img.shields.io/badge/Code-green)](https://github.com/GoPorts/Go.js#-code-copy-paste)
# What is Go.js?
**Go.js is still in beta, thus it can give you code that dosent work, be aware.**
Go.js is a JavaScript/TypeScript code that converts simple words into GO code.
Go.js is still under development.
you also must know that your antivirus might get trigget of the js code, if it does download the .txt file insted,
more info by scrolling down
> [!WARNING]
> Use it in DevTools since its code has prompts in it which your code editor might not support,
> thus your code editor will give you an error!
• How to setup
◦ after you've open Go.js, you can put some words in your coding space (go = ´´).
◦ you only need a JavaScript or TypeScript compiler, and the your done!
• All keywords for Go.js
◦ start, by typing start it'll create the package and import.
◦ print , we know what print does
◦ input , we also know what input does
◦ v!, to create a variable you do this ´v! hello = "world"´.
◦ if, if statement is more simpler with Go.js, this is how, if var is val then{}.• Why make this?
◦ since Go is in high demand, its also in high value.
◦ for people that can code in JavaScript but not Go.
◦ and if you use AI to convert the code, you might result in bad code.• Other info
◦ Go.js is source free, which means that other people can use it.
◦ Go.js is still under development.
◦ Go.js can only be used on DevTools (Inspect > Console), since its code also has prompts.# • Code, copy paste
[![Download zip](https://img.shields.io/badge/Version-v1.1.1-blue)](https://github.com/GoPorts)
```js
let go = `
start
print Hello, World!
v! name = input
if name is John then
v! age = input
if age is 30 then
fmt.Println("John is 30!")
else {
fmt.Println("John is not 30!")
}
else {
fmt.Println("Not John!")
}`;
`;
// example up here! /\
let gocode;gocode = "";
if (go.includes("start")) {
gocode += `package main\n\nimport "fmt"\n\nfunc main(){\n`;if (go.includes("print ")) {
const textToPrint = go.split("print ")[1].split("\n")[0].trim();
gocode += ` fmt.Println("${textToPrint}")\n`;
}if (go.includes("v! ")) {
const variableLine = go.split("v! ")[1].split("\n")[0].trim();
const [varName, operation] = variableLine.split("=").map(s => s.trim());
if (operation === "input") {
gocode += ` var ${varName} string\n fmt.Scanln(&${varName})\n`;
}
}if (go.includes("if ")) {
const conditionLine = go.split("if ")[1].split("then")[0].trim();
const [variable, comparison] = conditionLine.split("is").map(s => s.trim());
gocode += ` if ${variable} == "${comparison}" {\n`;const thenContent = go.split("then")[1].split("else")[0].trim();
if (thenContent) {
// Handle variables and inputs inside 'then'
if (thenContent.includes("v! ")) {
const variableLine = thenContent.split("v! ")[1].split("\n")[0].trim();
const [varName, operation] = variableLine.split("=").map(s => s.trim());
if (operation === "input") {
gocode += ` var ${varName} string\n fmt.Scanln(&${varName})\n`;
}
}
// Add the actual statements inside 'then'
gocode += ` ${thenContent}\n`;
}const elseContent = go.split("else {")[1].split("}")[0].trim();
if (elseContent) {
gocode += ` } else {\n`;// Handle variables and inputs inside 'else'
if (elseContent.includes("v! ")) {
const variableLine = elseContent.split("v! ")[1].split("\n")[0].trim();
const [varName, operation] = variableLine.split("=").map(s => s.trim());
if (operation === "input") {
gocode += ` var ${varName} string\n fmt.Scanln(&${varName})\n`;
}
}
gocode += ` ${elseContent}\n }\n`;
} else {
gocode += ` }\n`;
}
}gocode += `}\n`;
}console.log(gocode);
```