UNPKG
whistle.vase
Version:
latest (2.2.3)
2.2.3
2.2.2
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0.0
1.4.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
0.1.0
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
0.0.1-beta.1
0.0.1-beta
0.0.0
用于mock数据的whistle插件
github.com/whistle-plugins/whistle.vase
whistle-plugins/whistle.vase
whistle.vase
/
lib
/
engines
/
mock.js
14 lines
(11 loc)
•
231 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var
mock =
require
(
'mockjs'
);
module
.
exports
=
function
render
(
tpl, locals, callback
) {
try
{ tpl =
JSON
.
parse
(tpl); }
catch
(e) {}
try
{
return
callback
(
null
, mock.
mock
(tpl)); }
catch
(e) {
callback
(e); } };