boxbox

0.1.3 • Public • Published

node travis-ci

Node.js BoxBox

Micromodule

Example

npm i boxbox

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']()
 

BoxBox Server

npm i boxbox.server

const 
  boxbox = require('boxbox.server')
 
let box = boxbox('boxName', {
  post: (req, res) => {
    res.end('ok')
  }
})
.server('serverName')
  

Readme

Keywords

Package Sidebar

Install

npm i boxbox

Weekly Downloads

1

Version

0.1.3

License

GPL-3.0

Last publish

Collaborators

  • kekdude