moldeler

1.0.1 • Public • Published

Moldeler

Object modeler for node.js

Installing

npm install moldeler --save

Getting start

const Moldeler = require('moldeler');
  
Moldeler.register('myRule', (valueReceived, valueOfRule) => {
  return (valueReceived <= valueOfRule);
});
 
const userMold = new Moldeler({
  name: 'string',
  age: 'integer|myRule:10',
});
 
const userToValidate = {
  name: 'User name',
  age: 6,
};
  
userMold.test(userToValidate).then(() => {
  // validated
}).catch((errors) => {
  // errors: { age: myRule:10 }
});

Build Setup

# install dependencies
npm install
   
# start application
npm run start
  
# watch lib files and run on change.
npm run watch
  
# run tests
npm run teste

Readme

Keywords

none

Package Sidebar

Install

npm i moldeler

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • mentifg