包详细信息

content-genesis

servexyz5MIT0.5.7

generate interpolated content from template files

自述文件

logo

Build Status

Install

yarn add content-genesis

Use

const { template } = require("content-genesis");
let foo = { variable1: "Foo", variable2: "Bar" };
let fooTemplate = template("/path/to/template", foo);
  • See test for more detailed code.

How it works

  1. You define a template ( like this example )
  2. Next, you define the variables which will be interpolated eg. let foo = {component: "Foo"}
  3. You call template(/template/path, variablesObject)

Related