Skip to content

mvasilkov/rssi

Repository files navigation

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