Need help with nano?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

trix
457 Stars 78 Forks MIT License 35 Commits 0 Opened issues

Description

Simplest Templating Engine

Services available

!
?

Need anything else?

Contributors list

# 149,506
Postgre...
Databas...
postgre...
Rails
7 commits
# 44,418
PHP
Laravel
quasar-...
js
3 commits
# 356,296
slim
TypeScr...
Clojure
Shell
1 commit
# 285,107
HTML
React
TypeScr...
bem-met...
1 commit

NANO - Simplest Template Engine

Basic Usage

Assuming you have following JSON response:

data = {
  user: {
    login: "tomek",
    first_name: "Thomas",
    last_name: "Mazur",
    account: {
      status: "active",
      expires_at: "2009-12-31"
    }
  }
}

you can make:

nano("<p>Hello {user.firstname} {user.lastname}! Your account is <strong>{user.account.status}</strong></p>", data)

and you get ready string:

<p>Hello Thomas Mazur! Your account is <strong>active</strong></p>

Test page: testPage.html

Simple huh?

More Advanced Example

Displaying list of twitter search results (JSONP API)

http://jsfiddle.net/UXZDy/86/

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.