Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svisser/purescript-mustache
PureScript wrapper for mustache.js
https://github.com/svisser/purescript-mustache
bindings mustache purescript template
Last synced: 22 days ago
JSON representation
PureScript wrapper for mustache.js
- Host: GitHub
- URL: https://github.com/svisser/purescript-mustache
- Owner: svisser
- License: mit
- Created: 2015-08-05T22:37:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-20T05:39:31.000Z (over 7 years ago)
- Last Synced: 2024-12-01T09:06:54.195Z (about 1 month ago)
- Topics: bindings, mustache, purescript, template
- Language: PureScript
- Size: 16.6 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# purescript-mustache
PureScript wrapper for mustache.js## Installation
bower install --save purescript-mustache
npm install mustache
## CompilingIf you're use purescript-mustache on the front-end, you will need to compile using `pulp browserify`. Otherwise, compiling with `pulp build` should work.
## Example
Add the following to `Main.purs`:
``` purescript
module Main whereimport Prelude (Unit, bind)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)import Data.StrMap as S
import Mustache (MustacheEffect, render)
view :: S.StrMap String
view = S.insert "name" "John" (S.insert "value" "10000" S.empty)s :: String
s = "Hello {{name}}! You have just won ${{value}}!"main :: forall e. Eff (mustache :: MustacheEffect, console :: CONSOLE | e) Unit
main = do
result <- render s view S.empty
log result
```Run it using:
pulp run
## Module documentation
Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-mustache).