{"_id":"kommissar","_rev":"35-070a9e20a21b5bdc3c32655f1aee780e","name":"kommissar","dist-tags":{"latest":"1.0.15"},"versions":{"1.0.0":{"author":{"name":"Mark Engel"},"name":"kommissar","version":"1.0.0","main":"lib/index","dependencies":{"underscore":"1.3.3","validator":"0.4.9","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.2"},"_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"_id":"kommissar@1.0.0","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.25","_nodeVersion":"v0.6.19","_defaultsLoaded":true,"dist":{"shasum":"fd4c7c2df9472da004abf757712f6f52773aad9a","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.0.tgz","integrity":"sha512-34EjIHoP+vu2ZIEI4d+JuBFUP7/ZaogMWp46295KMxOeLG48Vo1/yhb/rg92pIRWZxnKpzXjmBqRcsgtQ1jgkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPwBNiH56dg3lY/gRTgpJWdqyq1/zW5ybY70vRBx1BNwIhAN28S5Vh9vyNR1udIMh0AmyWSo5PLPGtPtgx+/YWtYHz"}]},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.1":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.1","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.10","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI uploaded a [working example](https://github.com/mren/kommissar-example).\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.1","description":"Kommissar =========","dist":{"shasum":"87ce5c619c002241e86d09e1aaf81e52afd7d2cb","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.1.tgz","integrity":"sha512-WUB9Dkto1X/K/N4V8iVyuuTGfh1IuXRqs3J0z6t9BhRB4mICYlYqOSp58baV5ZYv847Fu5hBrD/qy21VRjF7VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGUcUrl1hSbseX+l16AleWdK0pJl8MeBk+Tb7Kz4e56XAiEA2MH2vp3JjCTWCJTce+ygsOPeD9MNmammrSjJTagswk4="}]},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.2":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.2","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.10","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.2","description":"Kommissar =========","dist":{"shasum":"9dd35576fc8f3f022f4eb6483d2f36b43f615618","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.2.tgz","integrity":"sha512-L46nSjCwklmOT0FFHAHlrcH2aIWs1yXzFkIp++5RmWp9DY+AIyQJUd3vJbauMX4/fYGw2P1qPqu/ch5RqZgvfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9EGF5dzKrEh/xzihDe2wU1vqmlZe+HbGS+55MxOSuXAiB0ZyigF29wamimY1vB2shA9tV/CPMemFnZ6gR0eBVPow=="}]},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.3":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.3","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.10","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.3","description":"Kommissar =========","dist":{"shasum":"a1f76bfb201b9e6691e81a95ea60d0610da839bb","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.3.tgz","integrity":"sha512-Fa2YS9q+gofp0bmtYGc1MmhvDbmjmz7ipqVAI1umtqwe51SFnL47RUCEwpjePMzonz2tPVJHjMOvq0DLzlyv1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHs0Wa+OjHWg5bqgCg7j/blXCbdXGN/OTNUUMAx30qUVAiEAw7YGzIuA+wKSNVzRV78gvgb/KRuXnaYMmB4UGZS225c="}]},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.4":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.4","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.11","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.4","description":"Kommissar =========","dist":{"shasum":"43449b7c483f76bab237b365d9a1e83d1f1f942b","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.4.tgz","integrity":"sha512-Nrgp89wWfTwDsfNJrzfT0bCHrE0luqPokd++OCHzk/1KnUwWHoqfubNXMK1ZdgET+Ht2Zikclk4yI3YcCOpfRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKgKaZBdzyQXm3WZ12U6Pfuf3GcDWv4GFHGVZqpuDHEAIhAO9KUfagvWOnX7NosHzG5TZPN6qqnU93oGmCtoPN3gnC"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.5":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.5","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.11","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.5","description":"Kommissar =========","dist":{"shasum":"7b428ac0e7f18ad5b42cb6323a95ad2b8e6aac38","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.5.tgz","integrity":"sha512-0GF4x5eKA0o1G3YLnX4kY/KoJnjpamIDcJRWZ9L9Fcbyr8et8i5B08F0erf4W6zcyAr12SAA7h0ijWTBm2PyxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYut4ZivNzeYMUJp0utYHLWClyBm8Q2DWYKlaCuWIb6gIgGeNNCwhsaLo44E8m7Ao+nS2IdeEjGhNzwFh01eF7O0g="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.6":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.6","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.11","async":"0.1.22","hashish":"0.0.4","jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.6","description":"Kommissar =========","dist":{"shasum":"35e90ed7a66fd6f785a190f866c08d0a30adee99","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.6.tgz","integrity":"sha512-DTkrGmhG5Wf8NqJUCNizH3tQvwam3izVpxhDkit/i4E6DlYUeQnnfqQalKoUlpVLSLjunKEw3ro/KOeuNSrEpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDapnFXdSGEwyalZfeUOfsnceNFUvDbYFiDPGw9FmQCZAiBJaQQ3Y1CSHg1Z1hpGe8Rog4phJfgjVCbzbylRXeOwzw=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.7":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.7","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.11","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.7","description":"Kommissar =========","dist":{"shasum":"16b31a3ee1ddbaee0a92f0d4f248b543990728c8","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.7.tgz","integrity":"sha512-JvOUCLFe1k+ahDhkFOCC+JeE6al3h5D5kkY6WtFILWMEPFT0N5xYOfjMjOAIIKIMjI+chwx3+IHhQx+IPxuC0w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPW/w3hHrLW+Itxfd/jxvYQ4TkRbDEz9V9UenHZcmUcgIhAP0O312mlZkLE37Vps1Yf2imYX14xvnkNaw+fRRhmtVg"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.8":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.8","main":"src/index","dependencies":{"underscore":"1.3.3","validator":"0.4.11","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.8","description":"Kommissar =========","dist":{"shasum":"8044578a2dc1165b6ac14d5d64132aa166a1cff8","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.8.tgz","integrity":"sha512-Vn22CEYy6Q0hsRD7r/WSrjzXSy4Pog5xup3BauioXA2wikfgyfeIKQgdcqDw6Ql585CF7/ivLIoi7zAs/3EdCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8p/quplqrL4DiSsqJtvAW9L1u+B+Imkkttif6Ch9nvwIgWrukpaAfpnX0XdYfT/taF2InmfPwgf9ODa441XKoRwY="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.9":{"author":{"name":"Mark Engel","email":"mark.c.engel@gmail.com","url":"http://engel.cx"},"name":"kommissar","version":"1.0.9","main":"src/index","dependencies":{"underscore":"1.3.3","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.9","description":"Kommissar =========","dist":{"shasum":"30493b520c222527631d31cdc66fabfd76475f9e","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.9.tgz","integrity":"sha512-MPGW0D2XtNtzPSJG4cpL1Sb9j6nNs6jcpKO99Wi6WvOOHnnDTC/KguEMbxsdUZi7VoQyPMOkzuzq+ps/E94+7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8ExDysA/upgaCcHQcYWbwGMWLYv5Lj5YNYygrX6k3yAIhANqPw+M273fs3JqFa6anESMfOAOX4S2h41SvS6vQpwbz"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.10":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.10","main":"src/index","dependencies":{"underscore":"1.4.2","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.10","description":"Kommissar =========","dist":{"shasum":"d67c892df94b39250509b70bee262f9bf00162c7","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.10.tgz","integrity":"sha512-CY0EHWqx5hz1opuukMJm0fODTGWE8meRCs13oAi873Ark7yvWXEmCSRTUfympo/XxGYvBM3eNA9kZc68IVLwDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZt8uFuCvAfPDkGlSP+Z+kwDAf7jAyAZkVletu0mEyJQIgJhaXmzY2wh+S5lILh8RqMWS3/EzdPbmAzEQJEOBa5Cw="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.11":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.11","main":"src/index","dependencies":{"underscore":"1.4.2","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3","coffee-script":"1.3.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.11","description":"Kommissar =========","dist":{"shasum":"81ff2312dec69cd49a0358f8cd82ad73ef49bafa","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.11.tgz","integrity":"sha512-AhI1gaR2OJDnoB1xsStza+G//9O2sancRbtGAE+pkU9tcub+OCkJq+Z+XoM2xgj5Ec2W2Dd1Q83+YzQXUcEABg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClG1/BxT9jq+oDoEyOVuG/R5JIDoyf0TUV6CLrPCNgJgIhAL8tsa0NESWpk4jqNVsPmA/9WPyXO6y3vAWt3ZV5Z3gY"}]},"_npmVersion":"1.1.62","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.12":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.12","main":"src/index","dependencies":{"underscore":"1.4.2","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3","coffee-script":"1.3.3"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","_id":"kommissar@1.0.12","description":"Kommissar =========","dist":{"shasum":"0dc0ffbcd39e29bc69a8fd31deac4cdcfdd222e1","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.12.tgz","integrity":"sha512-kUziaxFKZMXtmLj0wOtQrgq8BfmMl6gBbOkFX9MnT/M0dgOfuaa2Ry/gKev4idFTqjmZc5+5rz7R/CZBwZo8eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGT6sMuQo1+5bIKpQh7zVOX1MX/KNMglIZ80PD9eJUuiAiEAnSns3JOSRgg/MLt3ddHLWmmUgSeHGdnVDBXoYn65OXA="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.13":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.13","main":"src/index","dependencies":{"underscore":"1.4.3","async":"0.1.22","hashish":"0.0.4"},"devDependencies":{"jquery":"1.7.3","coffee-script":"1.4.0"},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","readmeFilename":"README.md","_id":"kommissar@1.0.13","description":"Kommissar =========","dist":{"shasum":"aed96749e75a86d3206a9ffa0195551c750b98bf","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.13.tgz","integrity":"sha512-q2P3e8/PuV3ygMhmLTvjI+aFF3rnTQLrIZfKgYytpGdsXKrjjy8HhT4OVw/XAaHdhXvKYkPkfyJO0Z6tj73A3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCQUSBArTlZvA03KevvVCvko9DKqsKAY4Ddh5JsH2gFwIhAO71Mdrla1f6oeCIsZDvhW71nLqAty7sXLBBp4lctMEU"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.14":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.14","main":"src/index","dependencies":{"underscore":"1.4.4","async":"0.2.6","hashish":"0.0.4"},"devDependencies":{"jquery":"1.8.3","coffee-script":"1.6.1","nodeunit":"0.7.4"},"scripts":{"test":"bash ./script/run-tests"},"readme":"Kommissar\n=========\n\n[![Build Status](https://travis-ci.org/mren/kommissar.png?branch=master)](https://travis-ci.org/mren/kommissar)\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","readmeFilename":"README.md","_id":"kommissar@1.0.14","description":"Kommissar =========","dist":{"shasum":"dae4b5fc6aecf4eb93de8147a4d906efa1eac64c","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.14.tgz","integrity":"sha512-KgxSsKweOIdgiJOcpndu4TjST0SiTmfSiFTi3pszKaMm7DIIe3YH6dRldjt8IQPrq6VZaZAlIXJDxjd5lpJhzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLSJZBpDUhXIdDnSsdywpo7ZR6fM9BEa5gkv0hGjlEOgIhAO9e9ofM5scOhu7nsL8qWxcC1jyVp2uXRKlwh6RFT/SH"}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"mren","email":"mark.c.engel@gmail.com"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]},"1.0.15":{"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"name":"kommissar","version":"1.0.15","main":"src/index","dependencies":{"underscore":"1.4.4","async":"0.2.6","hashish":"0.0.4"},"devDependencies":{"jquery":"1.8.3","coffee-script":"1.6.1","nodeunit":"0.7.4"},"repository":{"type":"git","url":"https://github.com/mren/kommissar.git"},"scripts":{"test":"bash ./script/run-tests"},"readme":"Kommissar\n=========\n\n[![Build Status](https://travis-ci.org/mren/kommissar.png?branch=master)](https://travis-ci.org/mren/kommissar)\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI deployed a [working example](https://kommissar.herokuapp.com). You can view\n[the source of the example](https://github.com/mren/kommissar-example) on GitHub.\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n```coffeescript\ncustomRule = (objectToValidate, parameter0, ..., parameterN)\n```\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n```coffeescript\nuserRule = (check)\n    # simple rule\n    check('email').isEmail()\n    # optional error messages are supported\n    check('password', 'Your Password is too short.').len 8\n    # rule are chainable\n    check('string').len(8,64).isAlpha()\n    # check if a field is valid in dependency on another field\n    # this rule makes sense if the user wants to edit its\n    # profile and the rule has to check if *no other* user\n    # has this email\n    check.('email').isUnique().with('id')\n```\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n```coffeescript\napp.post '/route',\n    kommissar.middleware() userRule,\n    updateModelWithNewDataMiddleware\n```\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n```coffeescript\nkommissar.middleware = (validations, failureMiddleware, successMiddleware)\n```\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n```coffeescript\nform = $ '#form'\nkommissar.clientValidate form, validations, rule, callback\n```\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","readmeFilename":"README.md","description":"Kommissar =========","bugs":{"url":"https://github.com/mren/kommissar/issues"},"homepage":"https://github.com/mren/kommissar","_id":"kommissar@1.0.15","dist":{"shasum":"474c5dd417ff6573ab0f90a75cd4792dc89f4057","tarball":"https://registry.npmjs.org/kommissar/-/kommissar-1.0.15.tgz","integrity":"sha512-8K6rPpPD/wkh2YmuzJF4Hq5hTC0qt/P9R1oHkuYeasj5LyQzLogECe6u40WG2ZjJCuoAl+vt+f1kVMXDPORF4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxN32AkeGNeNDDGXIevS/d5/C9eUZnQKLRGAbMpWvxuAiEA/RNDj7PxqzbOTh9ntdvPR4RghL6K2gZCoiCksyUs4ns="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"mren","email":"mark@engel.io"},"maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}]}},"readme":"Kommissar\n=========\n\nKommissar is hybrid Validation Framework for the client and the node.js\nserver.\nThe validation rules can be reused.\n\nThis guarantees a consistency in client side validation and security validation\nof the untrusted user data.\n\nExample\n=======\n\nI uploaded a [working example](https://github.com/mren/kommissar-example).\nHave a look.\n\nvalidations\n-----------\n\nvalidations are the methods used for validations. Kommissar provides\nbasic methods like `isInt`, `isEmail`, `len`, `min`, `max`, ...\n\nYou can find the complete list of available methods at\n[node-validator](https://github.com/chriso/node-validator).\n\nIf you want to add custom rules the signature of the functions is the following\n\n    customRule = (objectToValidate, parameter0, ..., parameterN)\n\nwhich should return a boolean value\n\nrules\n-----\n\nExample rule\n\n    userRule = (check)\n        # simple rule\n        check('email').isEmail()\n        # optional error messages are supported\n        check('password', 'Your Password is too short.').len 8\n        # rule are chainable\n        check('string').len(8,64).isAlpha()\n        # check if a field is valid in dependency on another field\n        # this rule makes sense if the user wants to edit its\n        # profile and the rule has to check if *no other* user\n        # has this email\n        check.('email').isUnique().with('id')\n\nRules should be stored in a single file that is made available to the\nserver and the client.\n\nAll available validation methods are imported from\n[node-validator](https://github.com/chriso/node-validator).\nYou can have a look at the available validations.\n\nIf you want to use custom validations, just extend `kommissar.validation`:\n\nenable middleware validation (server)\n-------------------------------------\n\n    app.post '/route',\n        kommissar.middleware() userRule,\n        updateModelWithNewDataMiddleware\n\n\nThis will only process `updateModelWithNewDataMiddleware` if the validation\nof `userRule` with the body was successful.\n\nThe signature of `kommissar.middleware` is\n\n    kommissar.middleware = (validations, failureMiddleware, successMiddleware)\n\n`validations` are the available validations.\nThe default option is to use the validations from `kommissar.validations`.\nIf you want to extend the available validations with custom one, you can use\nthis option.\n\n`failureMiddleware` is the middleware that gets executed if the verification\nfailed. On default this returns a `Bad Request` Status Code.\n\n`successCallback` is executed if the verification was successful. On default\nthis continues with the next middleware. In the example this would be the\n`updateModelWithNewDataMiddleware`\n\nenable middleware in the client\n-------------------------------\n\nIt is required that this module with all requirements is available for the\nclient. In the [example](https://github.com/mren/kommissar-example)\n[browserify](https://github.com/substack/node-browserify) is used.\n\n    form = $ '#form'\n    kommissar.clientValidate form, validations, rule, callback\n\nEnables the form `#form` for the validation.\nThe validation is executed if the user presses the submit button.\n\nAfter the validation is finished the callback is called with the results.\n\nThe callback has to decide what to do.\nAn example callback can be found in `kommissar.bootstrapDefault`, this\ncallback is optimized to print the error messages next to the form in an\nvanilla bootstrap page.\n\nConcept\n=======\n\nAsynchron Validation\n--------------------\n\nThe rules need to allow asynchronous validation.\nFor example checking the avalability of an username on the client is asynchronous.\nThus a validation framework has to deal with asynchron validation\n\nIsolation\n---------\n\nA Validation framework should be decoupled to allow unit testing.\nIt should be easy to unit test the rules.\nThis framework should not force the user to implement the validation process\nin a specific way.\n\nEasy to use\n-----------\n\nWritting rules should be fast and easy.\n\nBasic Rules\n-----------\n\nDefault Validators (like `isInt`, `len`) should be available by default.\nIt should also be easy to drop in custom rules (like `isUsernameTaken`).\n","maintainers":[{"name":"mren","email":"mark.c.engel@gmail.com"}],"time":{"modified":"2022-06-19T09:43:52.791Z","created":"2012-06-25T14:09:24.200Z","1.0.0":"2012-06-25T14:10:47.691Z","1.0.1":"2012-08-09T11:23:03.266Z","1.0.2":"2012-08-10T13:52:53.219Z","1.0.3":"2012-08-13T12:41:10.281Z","1.0.4":"2012-08-28T09:23:02.636Z","1.0.5":"2012-08-28T09:54:46.806Z","1.0.6":"2012-08-28T10:06:09.519Z","1.0.7":"2012-08-31T10:17:22.818Z","1.0.8":"2012-08-31T10:25:32.870Z","1.0.9":"2012-08-31T11:41:15.755Z","1.0.10":"2012-10-09T14:03:44.165Z","1.0.11":"2012-10-10T16:05:00.977Z","1.0.12":"2012-10-17T13:13:14.316Z","1.0.13":"2013-01-15T08:59:51.941Z","1.0.14":"2013-03-11T14:14:53.442Z","1.0.15":"2013-12-03T11:29:11.010Z"},"author":{"name":"Mark Engel","email":"mark@engel.io","url":"http://www.engel.io"},"description":"Kommissar =========","repository":{"type":"git","url":"https://github.com/mren/kommissar.git"}}