Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fujiharuka/at-template
JavaScript template engine with @{atSign} syntax.
https://github.com/fujiharuka/at-template
Last synced: 5 days ago
JSON representation
JavaScript template engine with @{atSign} syntax.
- Host: GitHub
- URL: https://github.com/fujiharuka/at-template
- Owner: FujiHaruka
- Created: 2019-06-13T14:43:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:50:24.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T02:37:36.850Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# at-template
[![Build Status](https://travis-ci.org/FujiHaruka/at-template.svg?branch=master)](https://travis-ci.org/FujiHaruka/at-template)
[![npm version](https://badge.fury.io/js/at-template.svg)](https://badge.fury.io/js/at-template)JavaScript template engine with @{atSign} syntax.
## Usage
* `@{variable}` for string replacement
* `@@{variable}` for escaping```js
const AtTemplate = require('at-template')
const template = AtTemplate.compile('Hello, my name is @{name}. I am from @{hometown}.')
const result = template({
name: 'Fuji',
hometown: 'Somewhere'
})console.log(result)
// > Hello, my name is Fuji. I am from Somewhere```
That's all.