string-template-modle
v1.0.2
Published
string-template-modle
Downloads
1
Maintainers
Readme
string template modle
- 使用配置文件初始化,便于管理
- 语法简介
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'