Boris
Boris, a pure javascript parser for the Redis serialization protocol RESP.
Boris is able to parse all kinds of Redis replies, also deeply nested multi-bulk replies.
Install
$ npm install boris [-g]
// clone repo
$ git clone git@github.com:rootslab/boris.git
require
var Boris = require( 'boris' );
See examples.
Run Tests
$ cd boris/
$ npm test
Constructor
Create an instance.
var b = Boris()
var b = new Boris()
Options
Default options are listed.
opt = {
return_buffers : true
}
Properties
WARNING: Don't mess with these properties.
Boris.rules : Object
Boris.crule : Rule
Boris.cdata : Buffer
Boris.mchk : Boolean
Boris.cpos : Number
Boris.peela : Peela
Methods
Arguments within [ ] are optional.
Boris#parse( Buffer data ) : undefined
Boris#reset() : undefined
Events
Boris.on( 'match', function ( Boolean isError, Array result, Function convert ) { .. } )
Boris.on( 'error', function ( String emsg, Buffer data ) { .. } )
Boris.on( 'miss', function ( Rule rule, Number position ) { .. } )
Boris.on( 'end', function () { .. } )
MIT License
Copyright (c) 2013 < Guglielmo Ferri : 44gatti@gmail.com >
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.