0.1.6 • Published 9 years ago

smalley v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Smalley

To give your data a checkup from the neckup, and affirmation that your data is valid, it's got everything it needs and, doggone it, people will like it!

Steps to run:

  1. Download/clone the module and put into your node_modules folder
  2. npm run install
  3. Test to make sure everything is loaded correctly: npm run test
  4. Go!

Examples

look for example definition files in the test/customerDefs or test/eventDefs folders

Example Definitions

{
	"firstName": {
		"type": "[object String]",
		"require": true,
		"minLength": 3,
		"maxLength": 15
	},
	"email" : {
		"type": "[object String]",
		"require": true,
		"match": "[a-zA-Z0-9_]+@\\.[a-zA-Z0-9_]{2,4}"
	}
	.
	.
	.
}

Example run

var smalley = require('smalley')
var testData = \{data: \{your object to test}, definitionPath: \'path/to/your/defs\'}
smalley.validate(testData, function(err, res) {
	if(err) 
		...do something with your err
	else
		...do something with success message and enjoy life	
});
0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago