-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
44 lines (33 loc) · 1.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
rssi
----
Ruby-like simple string interpolation for Node.js
Installation
------------
npm install rssi
bower install rssi
wget http://bit.ly/getrssi -O rssi.js
Usage
-----
fmt(<template> [, <options>])
<template> = [string] template with embedded Ruby-style references
(e.g. "hello, #{thing}")
<options> = [object, optional] configures the generator function:
blank: [boolean: false] interpolator will remove non-substituted
references in output
noCache: [boolean: false] do NOT cache the interpolator function
(e.g. {blank: true})
Examples
--------
var hello = fmt('hello, #{thing}')
hello({thing: 'world'})
// -> hello, world
hello({thing: 'shawarma'})
// -> hello, shawarma
var goodbye = fmt('goodbye#{addon}, #{typeof}#{thing}', {blank: true});
goodbye({thing: 'world');
// -> goodbye, world
goodbye({thing: 'world', typeof: 'cruel ', addon: ' and good riddance'});
// -> goodbye and good riddance, cruel world
License
-------
MIT