Skip to content

stongo/nsquishy-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nsquihsy Message

Provides a standardized message model to be used in NSQ

Module returns an extendable factory

Schema

The following model properties will be created for each model. The factory containers a schema property containing the Joi schema.

{
    id: Joi.string().default(uuid.v1, 'unique id'),
    source: Joi.string().required(),
    timestamp: Joi.date().format('x').default(Date.now, 'timestamp'),
    reference: Joi.string().default(''),
    payload: Joi.any().optional()```
}

Creating a message

var Message = require('nsquishy-message');
var message = new Message({
    source: 'build-worker',
    referemce: '9d107c4e-0414-45a1-9cec-99930d980de2',
    payload: 'build successful'
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published