feat: support package

This commit is contained in:
DIYgod
2019-09-16 18:19:15 +08:00
parent cdd7c9387f
commit 5c764f93f3
6 changed files with 118 additions and 98 deletions

21
lib/pkg.js Normal file
View File

@@ -0,0 +1,21 @@
const app = require('./app');
const pkg = (path) =>
new Promise((resolve) => {
app.callback()(
{
url: path,
method: 'GET',
headers: {},
socket: {},
},
{
setHeader: () => {},
end: (data) => {
resolve(data);
},
}
);
});
module.exports = pkg;