esmd

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2022 License: MIT

README

esmd

ESM Builder for esm.sh

Installation

go get github.com/esm-dev/esmd

Usage

import "github.com/esm-dev/esmd"

esm := esmd.New(esmd.Config{ ... })

// build instantly
output, err := esm.Build(esm.BuildOption{
  Name: "react-dom",
  Version: "18",
  Target: "es2020",
  Deps: esm.Deps {
    "react": "18",
  },
})
fmt.Println(esm.Get(output.id).Content)

// serve as http
http.HandleFunc("/esm", func(w http.ResponseWriter, r *http.Request){
  esmd.Serve(w, r)
})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL