const
boxbox = require('boxbox')
let box = new boxbox()
box.add('plus', (a, b) => a+b)
box.add('sum', (...x) => x.reduce(box.box['plus'], 0))
console.log(box.box['sum'](1, 2, 3))
const
box = require('boxbox')()
box.add('initDemo', { init: () => {
let x = boxbox('x', (x) => x*x)
return (a, b) => Math.sqrt(x.x(a)+x.x(b))
}})
console.log(box['initDemo'](3, 4))
const
boxbox = require('boxbox')
let x = boxbox()
x.add('script', 'fold/script.js', 'utf8')
x.add('interval', () => {
setInterval(box.restart, 7777, 'script')
})
x.box['interval']()
const
boxbox = require('boxbox.server')
let box = boxbox('boxName', {
post: (req, res) => {
res.end('ok')
}
})
.server('serverName')