Skip to content

Embedded Javascript (ES5.1) Templates for Golang

Notifications You must be signed in to change notification settings

cardigann/jstemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

JSTemplate

Golang templates with embedded Javascript, using Duktape.

Example

package main

import (
  "log"
  "time"

  "github.com/cardigann/go-jstemplate"
)

func main() {
  t := jstemplate.New(`
    fetchCheerio('http://duktape.org/')
      .then(function($) {
        return $("#front-blurp p:first-of-type").html();
      });
    `)

  log.Println(t.Render())
  // Duktape is an <b>embeddable Javascript</b> engine, with a focus on <b>portability</b> and compact <b>footprint</b>.
}

About

Embedded Javascript (ES5.1) Templates for Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages