@chengaoyuan/prepare

根据字符串模板生成处理函数

Usage no npm install needed!

<script type="module">
  import chengaoyuanPrepare from 'https://cdn.skypack.dev/@chengaoyuan/prepare';
</script>

README

prepare

npm version install size NPM Downloads Build Status Coverage Status

Installation

$ npm install @chengaoyuan/prepare

Usage

import prepare from "@chengaoyuan/prepare";
console.log(prepare(":a#:b")({ a: "abc", b: 2 })); // out: abc#2
console.log(prepare("select * from user where uid=:uid")({ uid: 10 })); // out: select * from user where uid=10

Testing

$ npm test