1.0.5 • Published 3 years ago

y8 v1.0.5

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

The classic selling points

  • 👌 Isomorphic, which means it works in both the server, and the client.
  • 🔥 Fast enough.
  • 🤏 Small enough.
  • 🤩 Simply the best itsy bitsy template engine ever made.

Installation

$ npm i --save y8

Usage

const template = require('y8');

const html = `
<html>
    <title>{{hello}}</title>
    <body>
        <h1>{{hello}}</h1>
        <ul>
            <li>{{tasks.one}}</li>
            <li>{{tasks.two}}</li>
            <li>{{tasks.three}}</li>
        <ul>

        <footer>
            <p>Made in {{madeIn}} by {{author}}<p>
        </footer>
    </body>
</html>
`;

const replacements = {
    hello: 'Hello, World',
    tasks: {
        one: 'This is task one',
        two: 'This is task two',
        three: 'This is task three',
    },
    madeIn: 'Norway',
    author: 'Bjarne Oeverli',
};

template(html, replacements);

/*
<html>
    <title>Hello, World</title>
    <body>
        <h1>Hello, World</h1>
        <ul>
            <li>This is task one</li>
            <li>This is task two</li>
            <li>This is task three</li>
        <ul>

        <footer>
            <p>Made in Norway by Bjarne Oeverli<p>
        </footer>
    </body>
</html>
*/

License

MIT - © Bjarne Oeverli - See LICENSE

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

4 years ago