func2tag

0.1.0 • Public • Published

func2tag

Convert any string-producing function to a renderer for JS tagged strings.

API

This module exports one function:

func2tag(f)

Return a function that renders a tagged string by inserting into each slot the result of f(a, i, v) where a is the value for the slot, i is the slot index ("slot number", counting from zero), and v is the list (array) or all slot values.

Usage

See test/usage.mjs.

Known issues

  • Needs more/better tests and docs.

 

License

ISC

Readme

Keywords

Package Sidebar

Install

npm i func2tag

Weekly Downloads

2

Version

0.1.0

License

ISC

Unpacked Size

2.61 kB

Total Files

5

Last publish

Collaborators

  • mk-pmb