@cloudpss/template
Version:
Lightweight string and object templating utilities with interpolation and formula support.
19 lines (13 loc) • 438 B
Markdown
# @cloudpss/template
Lightweight string and object templating utilities with interpolation and formula support.
Use `=` prefix for formula evaluation and `$` prefix for string interpolation.
## Example
```ts
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' }
```