Socket
Socket
Sign inDemoInstall

gleam-compiler

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gleam-compiler

gleam wasm compiler


Version published
Weekly downloads
14
decreased by-33.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Gleam Compiler

The Gleam compiler in WASM, typed and built for easy use.

npm install gleam-compiler
import { compile, type CompilerOptions, target, mode } from "gleam-compiler";

const options = {
    target: target.JavaScript // or "javascript"
    files: {"/src/main.gleam": "pub fn main() { 42 }"},
    dependencies: [],
    mode: mode.Dev // or "Dev"
} satisfies CompilerOptions;

const { Ok, Err } = compile(options);

if (Ok) {
    console.log(Ok) 
    // {"/build/dev/javascript/gleam-wasm/gleam.mjs": "export class CustomType {\n  inspect() {\n    let field = (label) => {\n      let value = inspect(this[label]);\n...", "/build/dev/javascript/gleam-wasm/main.mjs": "export function main() {\n  return 42;\n}\n"}

}

Keywords

FAQs

Last updated on 13 Sep 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc