Skip to content
Ruby-like simple string interpolation for Node.js
Branch: derelict
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
test_client
usage
.gitignore
.jshintrc
.npmignore
LICENSE
Makefile
README
bower.json
component.json
package.json
rssi.js
rssi.min.js
test_min.sh

README

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
You can’t perform that action at this time.