sume

1.2.1 • Public • Published

Sume.js Build Status

Low effort DOM templating for the frontend


CDN

jsDelivr


Usage

const Sume = require("sume");

let source = `
    <a href="{{ url }}">{{ title }}</a>

    <span>
        {{ content }}

        Escaped delimiters: \\{{ hello! }}
    </span>
`;

let template = Sume.compile(source);
let context = {
    url: "https://github.com/jackdalton2/Sume.js",
    title: "Sume.js",
    content: "Low effort DOM templating for the frontend"
};

let renderedElement = template(context);

renderedElement (String):

<a href="https://github.com/jackdalton2/Sume.js/">Sume.js</a>

<span>
    Low effort DOM templating for the frontend

    Escaped delimiters: {{ hello! }}
</span>

Readme

Keywords

Package Sidebar

Install

npm i sume

Weekly Downloads

6

Version

1.2.1

License

MIT

Unpacked Size

17 kB

Total Files

11

Last publish

Collaborators

  • jackdalton