JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q51765F
  • License MIT

Expression-based templating engine for reusability and injectable semantics.

Package Exports

  • pixie

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pixie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Pixie

A lightweight, pluggable, and browser/node-compatible templating engine.

Pixie is a simple templating library, where expressions are points where new data goes (such as {{foobar}}). You can plug in custom engines into Pixie in order to interpret these expressions however you want. This allows you to build syntax and semantics inside of templates in a modular way. Pixie itself is very lightweight, since it only provides the tools necessary to inject data and interpret the expressions. It also works inside both the browser or Node.js.

Installation

$ npm install --save pixie

Usable inside of the browser with Browserify/Webpack/other bundlers.

Usage

const pixie = require('pixie');

// - Rendering
pixie.render(
  'Hello {{world}}',
  {world: 'foo'}
);
// => 'Hello foo'

// - Parsing
pixie.parse('Hello {{world}}');
// => { partials: ['Hello ', ''], expressions: ['world'] }

// - Compiling
pixie.compile(
  { partials: ['Hello', ''], expressions: ['world'] },
  { world: 'Earth' }
);
// => 'Hello Earth'

See docs for more information.

Credits

  • Thanks to Dustin for designing logo.
jamen
Jamen Marzonie