This package has been deprecated

Author message:

For now, this project is deprecated. I no longer use or work on it, and doubt others are using it. If by any chance you were using this, and would like to see more of it in some form, let me know: justnvdm@gmail.com

oz-msg

0.1.0 • Public • Published

oz-msg

Build Status

oz's message components

install

browser

$ bower install oz-msg

node.js

$ npm install oz-msg

usage

browser

For bundling systems supporting commonjs, require('oz-msg').

The library is also accessible via one of the build/ files:

  • oz-msg.js: oz-msg without its dependencies
  • oz-msg.all.js: oz-msg with its dependencies bundled
  • oz-msg.min.js: minified build of oz-msg
  • oz-msg.all.js: minified build of oz-msg with its dependencies bundled

If no module system is found, the oz-msg is exposed as the global ozmsg.

nodejs

require('oz-msg')

api

ozmsg.req(type, data)

Creates a request of the given type and data, where type is a string and data is any JSON-serializable object.

The returned request object contains the following properties:

id: the request's uuid type: the given type data: the given data

ozmsg.rep(req, data)

Creates a success reply to the given request req and with the given data, where req is an ozmsg.req object and data is any JSON-serializable object.

The returned reply object contains the following properties:

id: the reply's uuid req: the corresponding request req err: set to null data: the given data

ozmsg.err(req, err)

Creates an error reply to the given request req and with the given error err, where req is ozmsg.req object and err is any JSON-serializable object.

The returned reply object contains the following properties:

id: the reply's uuid req: the corresponding request req data: set to null err: the given error err

Readme

Keywords

Package Sidebar

Install

npm i oz-msg

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • justinvdm