pixie-dot

3.0.0 • Public • Published

pixie-dot NPM version

Access template data with dot notation

Installation

$ npm install --save pixie-dot

Usage

dot(template, data)

Returns compiled template, with support for dot notation in the expressions

var dot = require('pixie-dot')
var pixie = require('pixie')
 
var template = pixie('Hello {{input.world}} and {{input.person}}!')
 
dot(template, {
  input: { world: 'Mars', person: 'Jamen' }
})
// => 'Hello Mars and Jamen!'

You can also select arrays with numbers:

var template = pixie('Hello {{inputs.2.world}} and {{world.2.person}}!')

License

MIT © Sean Wilson

Package Sidebar

Install

npm i pixie-dot

Weekly Downloads

2

Version

3.0.0

License

MIT

Last publish

Collaborators

  • jamen
  • programmatical