{"_id":"protocol","_rev":"28-622eb961fb731c10225668ee3601c155","name":"protocol","description":"Protocols for Node.JS","dist-tags":{"latest":"0.1.4"},"versions":{"0.0.1":{"name":"protocol","id":"protocol","version":"0.0.1","description":"Pattern matching for JavaScript.","keywords":["functions","pattern","match","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10"},"engines":{"node":"0.4.x"},"scripts":{"test":"node tests/test-all.js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmJsonOpts":{"file":"/Users/gozala/.npm/protocol/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"protocol@0.0.1","dependencies":{},"_engineSupported":false,"_npmVersion":"1.0.26","_nodeVersion":"v0.5.8","_defaultsLoaded":true,"dist":{"shasum":"b159ff77b6d835efbebc112be8bebccb3e39d02b","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.0.1.tgz","integrity":"sha512-5UGXofGFyEP8ht5eRtkTmkEQPsFl7Bb1ipVP/Ko+S7iwFaQyibbn7ufOjNGpCKhOYvQ9A5Svkt7FjVQodXeSCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiA8V+uy1YOW2mS7lCQqZ/roC/XHXbBSdzIUi+5KYJLAiEAyKeiS9HSR/USkXQ1yV0y63PVqoZtcqP0f6eAAc9g11o="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.0.3":{"name":"protocol","id":"protocol","version":"0.0.3","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"dependencies":{"dispatcher":">=0.0.2"},"devDependencies":{"test":">=0.0.10"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.0.3","_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"4baafdf6637d3955f621cfb84dc962179615e504","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.0.3.tgz","integrity":"sha512-EVbJ4Op9mF4iK8w4/n5Dd41p5RwDVv+Bjpk3aTV3RYChNQVs1yzt8k54zY4VfYyKm/UI42w9fFlI0IWottwEyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDzseMlwrpL6rvBUXT5bjayxy/NU4qtFQQDw9xKZet7ZAiEAoObCu7h9ZN+LsmkvaBcjniH2CswKbyxW87+ox5AcCOo="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.2.0":{"name":"protocol","id":"protocol","version":"0.2.0","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.2.0","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"6e1b1ce5e168f9e5a4ac1b081ea604e303f306f8","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.2.0.tgz","integrity":"sha512-2I+rz73roGgjXlkjIoXRRnBVLHZCiWf+B9RA3dmqsgW+SF74T9aDe5B/qeJDCKXZUfdg2i/k6sQ059hCy7ru1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2DlyAAsyI8JgSRgbeVxPgAf4K7F/vWIWQZWW7rjd3aAIgfaeZ5EDHZpTkwg6CjvPxeiuawX2lLoobsFgwdaIXt/A="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.2.1":{"name":"protocol","id":"protocol","version":"0.2.1","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.2.1","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"61ccbd2f4994718cbd993ca9ed4b3ea7492dccb3","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.2.1.tgz","integrity":"sha512-fMddEl7qcUXpe0gSQ7CZw7+wbwNa42aDwBNVOjFpfPYKcFLRRREqCcPhE6YW6lXfmdb7ZrFmgZBFfjV2jbUGSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhXhSvSJLFeBQDnqCB7oeAFIPNP+UF5HG4TzlB1UferQIgTX6Rv2ZGH/Ao6RH+aa5UAB1sVTtdv7GAekeXvO04T4w="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.2.2":{"name":"protocol","id":"protocol","version":"0.2.2","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.2.2","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"cedf9434dc8481532911a3d2ccc72735b30c8452","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.2.2.tgz","integrity":"sha512-7RqsqFDVxrKtd2A6tzJiDWCQdGIBQEan6CA9gGr+/4tdQR50aFThrlWXVhxnxOoH74Ri3CG9qRdxNhuFTiJf2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCO/cpl5n9YtE1lXy2/fT69vkD+ILPYimbJhvupp4pgegIhAPHn8WIQPZraZfdIZw3dqOvzmIQWsg6qw5gc6eQV4g4/"}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.2.4":{"name":"protocol","id":"protocol","version":"0.2.4","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.2.4","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.101","_nodeVersion":"v0.5.9","_defaultsLoaded":true,"dist":{"shasum":"a3029a50a4b40522610fe9f3e107f0c9a4ca26d0","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.2.4.tgz","integrity":"sha512-0jPUjvz6PJgmK4jMp+lcfOiuF1BlS1snkBesSAoVO6yLrS1CnTgeZc6Cb6hEMNB1i8JV35ZGudywsARaSOFY5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCg3442xU7eJuSaNum9NY8MdVrIfCnPQ+p5KYabWoyFcwIhALmyZjwH8qm+ScJx/+o9/R2mWKEKnwkcW3SJQP4J0EIh"}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.3.0":{"name":"protocol","id":"protocol","version":"0.3.0","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.3.0","dependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"5a571302782388b0a99b21d69a48e218d0d8f345","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.3.0.tgz","integrity":"sha512-hIgyAS7PcXoEgYqz4u1897gw02EQzB19Sjof38nVyKONlKMaqqIq6+9dPghsKBricSYj5xet3DDlpOT1W4OIkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe5BdtqNzAvhwL6cowleddWRqnCrW4pdl7lUK4SFq9ZwIgW69n5eewZbyUO6cZE0b0NZdPYKpUu1c34BhV4eWNSO8="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.3.1":{"name":"protocol","id":"protocol","version":"0.3.1","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.3.1","dependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"99ea9592bf6be740ef4ce0a1094ec4f60c467bf7","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.3.1.tgz","integrity":"sha512-wHJqtwcO9NcmmgThJ6aH+8et5v+iQBJ/2INfUyk7M6bUDT/FNDfkDQAsVdR5koMkinlnROJXs+gXEpxcd27KFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDO0oLZPHKcl3Cek1qbcblfGDz4MfKcWbP5GUoo8TJmzAiEA1mOWKn8cs+DwPBBfhaSNB4ZUkSFlW6IAeZGtOIzsa3E="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.4.0":{"name":"protocol","id":"protocol","version":"0.4.0","description":"Protocol based polymorphism for javascript.","keywords":["polymorphism","protocol","cotract"],"author":{"name":"Irakli Gozalishvili","email":"rfobic@gmail.com","url":"http://jeditoolkit.com"},"homepage":"https://github.com/Gozala/protocol","repository":{"type":"git","url":"git://github.com/Gozala/protocol.git","web":"https://github.com/Gozala/protocol"},"bugs":{"url":"http://github.com/Gozala/protocol/issues/"},"devDependencies":{"test":">=0.0.10","repl-utils":">=0.0.1","swank-js":">=0.0.1"},"engines":{"node":">=0.4.x"},"main":"./core.js","scripts":{"test":"node tests/test-all.js","repl":"node ./node_modules/repl-utils","swank":"node ./node_modules/swank-js"},"licenses":[{"type":"MIT","url":"http://jeditoolkit.com/LICENSE"}],"_npmUser":{"name":"gozala","email":"rfobic@gmail.com"},"_id":"protocol@0.4.0","dependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"3114644f63c260c7e9395b490c9c3aa5addce384","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.4.0.tgz","integrity":"sha512-SXRY3ILGvNwTMPw25O6el4CZ+ejcNsjYv1IudCGuwt6Eif05tYsBGaDvclYNA89csbB5luxy/1aAgfyqWcsVlg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgTcNtDb/hN8+WrBHbKWiMOngeZf29mMAL0r+d/ZurNAiEAjRjR2xPXr5xw7biHNt3lEmYrNN9wLOOCbC3Sg5Y3ji4="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"}],"deprecated":"protocol library is planned to be replaced on npm with a different one on April 3rd, 2017. If that affects you lets discuss that in https://github.com/Gozala/protocol/issues/3"},"0.1.3":{"author":{"name":"Wouter Klijn","email":"contact@wuhkuh.com","url":"https://wuhkuh.com"},"bugs":{"url":"https://github.com/wuhkuh/protocol/issues"},"description":"Protocols for Node.JS","devDependencies":{"benchmark":"^2.1.4","pre-commit":"^1.2.2","standard":"^10.0.2","tap-spec":"^4.1.1","tape":"^4.6.3"},"engines":{"node":">= 6.0.0"},"engineStrict":true,"keywords":["universal","network","protocol","parser","generator"],"license":"MIT","main":"protocol.js","name":"protocol","pre-commit":"test","repository":{"type":"git","url":"git+https://github.com/wuhkuh/protocol.git"},"scripts":{"bench":"node benchmark/benchmark.js","benchmark":"npm run bench","lint":"standard","test":"standard && tape test/test.js | tap-spec"},"version":"0.1.3","website":"https://github.com/wuhkuh/protocol","gitHead":"c40ab21f3d65162e8712dc467e5316d5728e3e46","homepage":"https://github.com/wuhkuh/protocol#readme","_id":"protocol@0.1.3","_shasum":"190103d56ee303c2a082374893149fc967ebfd71","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.3","_npmUser":{"name":"wuhkuh","email":"contact@wuhkuh.com"},"dist":{"shasum":"190103d56ee303c2a082374893149fc967ebfd71","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.1.3.tgz","integrity":"sha512-Yt466jAEn3ZMPSC12M2ot1zJzfwWCDepebTJE3i8OTSZyqD05pYQcJrjzhDD/Yz0TF96zviplO+K9F9Cxhm4JA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPyri3gq+fHUiwfVrFGiSo7IeDgf8sWfShvmmKbIWnWwIgFPjDy127uF9ItKhfaQha2MSyz9orRTR84Ttp3/jAyiE="}]},"maintainers":[{"name":"gozala","email":"rfobic@gmail.com"},{"name":"wuhkuh","email":"contact@wuhkuh.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/protocol-0.1.3.tgz_1492202872805_0.1651737482752651"}},"0.1.4":{"author":{"name":"Wouter Klijn","email":"contact@wuhkuh.com","url":"https://wuhkuh.com"},"bugs":{"url":"https://github.com/wuhkuh/protocol/issues"},"description":"Protocols for Node.JS","devDependencies":{"benchmark":"^2.1.4","pre-commit":"^1.2.2","standard":"^10.0.2","tap-spec":"^4.1.1","tape":"^4.6.3"},"engines":{"node":">= 6.0.0"},"engineStrict":true,"homepage":"https://github.com/wuhkuh/protocol#readme","keywords":["universal","network","protocol","parser","generator"],"license":"MIT","main":"protocol.js","name":"protocol","pre-commit":"test","repository":{"type":"git","url":"git+https://github.com/wuhkuh/protocol.git"},"scripts":{"bench":"node benchmark/benchmark.js","benchmark":"npm run bench","lint":"standard","test":"standard && tape test/test.js | tap-spec"},"version":"0.1.4","gitHead":"6efc77554cbe5f763682672ac312b5555bc1b1da","_id":"protocol@0.1.4","_shasum":"e2ecd558c39c68ac93ffae21351d5b98bbb46b27","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.3","_npmUser":{"name":"wuhkuh","email":"contact@wuhkuh.com"},"dist":{"shasum":"e2ecd558c39c68ac93ffae21351d5b98bbb46b27","tarball":"https://registry.npmjs.org/protocol/-/protocol-0.1.4.tgz","integrity":"sha512-Bze8z2uGEUu2xE9Hc6NeVcjPPLdOoaMeL94367BhVQ4HH4kAGkWNFOuP8Z8QCYTMMW03R7YJDcehemc6RvHhiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEBYm37CxPRhkIiQyxQ62c4Pzfsgchh4qSqPZ1bnDT3lAiA1zkf8st90TAIVt0p1aQFo0Iw4YhQJz1MmmhaMe4RnEA=="}]},"maintainers":[{"name":"wuhkuh","email":"contact@wuhkuh.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/protocol-0.1.4.tgz_1492351613331_0.13257013843394816"}}},"maintainers":[{"name":"wuhkuh","email":"contact@wuhkuh.com"}],"time":{"modified":"2022-06-24T20:57:43.465Z","created":"2011-10-10T16:55:06.489Z","0.0.1":"2011-10-10T16:55:07.960Z","0.0.3":"2012-02-03T16:16:53.171Z","0.2.0":"2012-02-05T21:27:44.271Z","0.2.1":"2012-02-22T07:48:42.414Z","0.2.2":"2012-02-23T06:40:41.377Z","0.2.4":"2012-03-22T02:11:03.422Z","0.3.0":"2012-04-10T22:12:02.478Z","0.3.1":"2012-04-10T23:43:43.837Z","0.4.0":"2012-05-17T23:40:56.859Z","0.1.3":"2017-04-14T20:47:53.395Z","0.1.4":"2017-04-16T14:06:53.989Z"},"author":{"name":"Wouter Klijn","email":"contact@wuhkuh.com","url":"https://wuhkuh.com"},"repository":{"type":"git","url":"git+https://github.com/wuhkuh/protocol.git"},"users":{"m42am":true,"colbyr":true},"homepage":"https://github.com/wuhkuh/protocol#readme","keywords":["universal","network","protocol","parser","generator"],"bugs":{"url":"https://github.com/wuhkuh/protocol/issues"},"readme":"# Protocols for Node.JS [![Build Status](https://travis-ci.org/wuhkuh/protocol.svg)](https://travis-ci.org/wuhkuh/protocol) [![Greenkeeper badge](https://badges.greenkeeper.io/wuhkuh/protocol.svg)](https://greenkeeper.io/)\r\n### Create and edit network protocols the easy way. <a href=\"https://github.com/feross/standard\"><img align=\"right\" src=\"https://cdn.rawgit.com/feross/standard/master/badge.svg\"></a>\r\n\r\nNo more bitwise logic - give it a template and let it do the work for you.\r\n\r\n  * <a href=\"#installation\">Installation</a>\r\n  * <a href=\"#example\">Example</a>\r\n  * <a href=\"#api\">API</a>\r\n  * <a href=\"#support\">Supported Node versions</a>\r\n  * <a href=\"#license\">License</a>\r\n\r\n<a name=\"installation\"></a>\r\n\r\n## Installation\r\n\r\n```js\r\nnpm install protocol --save\r\n```\r\n\r\n<a name=\"example\"></a>\r\n\r\n## Example\r\n\r\n```js\r\nconst Protocol = require('protocol')\r\n\r\nconst myProtocol = new Protocol({\r\n  header: [{\r\n    firstBit: { bitLength: 1 },\r\n    secondBit: { bitLength: 1 }\r\n  }],\r\n  payloadLength: { bitLength: 4 },\r\n  payload: { byteLength: 'payloadLength', encoding: 'utf8' } \r\n})\r\n\r\n/* \r\n * 0x90 is hex for '1001 0000'\r\n * firstBit: 1, secondBit: 0, payloadLength: 4 (bitwise 0100)\r\n * payload: 'abcd' (0x61 to 0x64)\r\n */\r\nmyProtocol.parse(Buffer.from([0x90, 0x61, 0x62, 0x63, 0x64]))\r\n\r\n/*\r\n * '0 1 0010 00' to hex -> 0x48\r\n * 'bd' -> 0x62, 0x64\r\n * result: Buffer <0x48, 0x62, 0x64>\r\n */\r\nmyProtocol.generate({\r\n  header: {\r\n    firstBit: 0,\r\n    secondBit: 1\r\n  },\r\n  payloadLength: 2, // this has to be set explicitly!\r\n  payload: 'bd'\r\n})\r\n```\r\nView the <a href=\"#api\">API</a> or the <a href=\"https://github.com/wuhkuh/protocol/tree/master/example\">example folder</a> in this project's repository for a closer look.\r\n\r\n> Good practice:  \r\n> Create a protocol in a separate file and share it between clients.\r\n\r\n<a name=\"api\"></a>\r\n\r\n## API\r\n\r\n* <a href=\"#protocol\"><code>Protocol</code></a>\r\n* <a href=\"#generate\"><code>protocol#<b>generate()</b></code></a>\r\n* <a href=\"#parse\"><code>protocol#<b>parse()</b></code></a>\r\n\r\n---\r\n<a name=\"protocol\"></a>\r\n\r\n### `Protocol(schema)`\r\n\r\n`Protocol` is the exposed class. Create it by using `new Protocol(schema)`.  \r\nThe `schema` parameter is an object with the following notation:\r\n\r\n```js\r\nconst schema = {\r\n  header: [{\r\n    firstBit: { bitLength: 1 },\r\n    secondBit: { bitLength: 1 }\r\n  }],\r\n  payloadLength: { bitLength: 4 },\r\n  payload: { byteLength: 'payloadLength' }\r\n}\r\n```\r\n\r\nProtocols are read in top-to-bottom order, with the input in Big Endian (network order as  \r\ndefined in <a href=\"https://tools.ietf.org/html/rfc1700\">RFC 1700</a>). This means that a Buffer will be parsed and generated from left to right.\r\n\r\nThe current supported options are:\r\n\r\n* `bitLength` in amount of bits, or a string that points to another key when variable. \r\n* `byteLength` in amount of bytes, or a string that points to another key when variable.\r\n* `dict` as an object containing values for parsing and generating.\r\n* `encoding` as a string containg the required <a href=\"https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end\">encoding</a>.  \r\nIf not present, parsing returns a Buffer.\r\n* `type` as a class, only supporting Boolean at this moment.  \r\nThis converts outputs to Booleans (all non-zeros are true).\r\n\r\n---\r\n<a name=\"generate\"></a>\r\n\r\n### `Protocol.generate(object)`\r\n\r\nThis method generates a Buffer from an Object. It starts with dictionary translation and  \r\ntype handling, followed by concatenation and outputting a single Buffer.\r\n\r\n* `object: Object`  \r\nInput object that shall be translated to a Buffer using a Protocol.\r\n\r\nIf there is no encoding given during generation of a Buffer, it uses UTF-8.  \r\nIf the input already contains a value of type Buffer, it will retain this Buffer.  \r\nWhen a length is variable and points to key `x`, `x` does not automatically get a value assigned.  \r\n__This has to be set explicitly!__\r\n\r\n---\r\n<a name=\"parse\"></a>\r\n\r\n### `Protocol.parse(buffer)`\r\n\r\nThis method generates an Object from a Buffer. It splits the individual bits and bytes,  \r\nfollowed by type handling and dictionary translation.\r\n\r\n* `buffer: Buffer`  \r\nInput buffer that shall be translated to an Object using a Protocol.\r\n\r\nIf there is no encoding given during parsing of a Buffer, it will retain this Buffer.\r\n\r\n<a name=\"support\"></a>\r\n\r\n## Supported Node versions\r\n\r\n| Version  | Supported until |\r\n| --------- | :---------------: |\r\n| Node v7 |    2017-06-01   |\r\n| Node v8 |    2019-12-31   |\r\n\r\n<a name=\"license\"></a>\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","license":"MIT"}