
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@live-codes/go2js
Advanced tools
Compile Go to JS in the browser (using GopherJS)
Based on GopherJS Playground
The motive for this project was to enable client-side compiling of Golang to JavaScript to run in the browser for LiveCodes.
UMD:
<!-- <script src="https://cdn.jsdelivr.net/npm/go2js/build/go2js.js"></script> -->
<script src="go2js.js"></script>
<script>
const code = `
package main
import ("syscall/js"
"fmt")
func main() {fmt.Println("Hello, from Go")
js.Global().Call("alert", "Hello, JavaScript")
println("Hello, JS console")}
`;
window.go2js
.format(code)
.then((formatted) => {
console.log(formatted);
// return window.go2js.compile(formatted, 'https://unpkg.com/go2js/build/');
return window.go2js.compile(formatted);
})
.then(eval)
.catch(console.warn);
</script>
ESM:
import { compile, format } from 'https://unpkg.com/go2js';
const code = `
package main
import ("syscall/js"
"fmt")
func main() {fmt.Println("Hello, from Go")
js.Global().Call("alert", "Hello, JavaScript")
println("Hello, JS console")}
`;
format(code)
.then((formatted) => {
console.log(formatted);
// return compile(formatted, 'https://unpkg.com/go2js/build/');
return compile(formatted);
})
.then(eval)
.catch(console.warn);
Run npm start to start a server (http://127.0.0.1:8080) and watch for changes.
Please do!
Feedback, ideas and pull requests are highly appreciated.
BSD 2-Clause "Simplified" License same as GopherJS lisence
FAQs
Compile Go to JS in the browser (using GopherJS)
The npm package @live-codes/go2js receives a total of 11 weekly downloads. As such, @live-codes/go2js popularity was classified as not popular.
We found that @live-codes/go2js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.