1.0.2 • Published 7 years ago

string-template-modle v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

string template modle

  1. 使用配置文件初始化,便于管理
  2. 语法简介

Installation

npm install string-template-modle

Examples

const StringTM = require('string-template-modle')

const config = {
  hello: '{someone say}: hello world!',
  goodMorning: '{good morning}! {someone name}'
}

const strtm = new StringTM(config)

let str = strtm.hello.use('jhin')
console.log(str)
// => 'jhin: hello world!'

str = strtm.goodMorning.use('good morning', 'jhin')
console.log(str)
// => 'good morning! jhin'

str = strtm.goodMorning.use('good afternoon', 'tom')
console.log(str)
// => 'good afternoon! tom'