const Order = require('packhouse/plugins/order')
const Packhouse = require('packhouse')
let main = Packhouse.Main((packhouse, event) => {
// 可以傳遞參數
console.log(event.hello) // world
// 可以定義事件
packhouse.on('run', () => { ... })
// 回傳基本資料
return {
plugins: [
Order
],
groups: {
'math': () => {
return {
data: require('./math'),
options: {}
}
}
},
mergers: {
'myMerger': () => {
return {
data: require('./myMerger'),
options: {}
}
}
}
}
})
let packhouse = main({
hello: 'world'
})
packhouse.tool('math/sum').action(...)
import { Main } from 'packhouse/types'
const Main: Main = Packhouse.Main
const main = Main(() => ({})
const packhouse = main()