JSPM

  • Created
  • Published
  • Downloads 749
  • Score
    100M100P100Q87753F
  • License MIT

Package Exports

  • @cloudpss/template

Readme

@cloudpss/template

Lightweight string and object templating utilities with interpolation and formula support.

Use = prefix for formula evaluation and $ prefix for string interpolation.

Example

import { template } from '@cloudpss/template';

const greet = template({
  message: '$Hello, ${name}',
  type: '=type',
});
console.log(greet({ name: 'World', type: 'text' }));
// { message: 'Hello, World', type: 'text' }