Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
boris
Advanced tools
Readme
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.
$ npm install boris [-g]
// clone repo
$ git clone git@github.com:rootslab/boris.git
require
var Boris = require( 'boris' );
See examples.
$ cd boris/
$ npm test
Create an instance.
var b = Boris()
// or
var b = new Boris()
Default options are listed.
opt = {
/*
* For default, the parser returns Buffers,
*/
return_buffers : true
}
WARNING: Don't mess with these properties.
/*
* Protocol rules: bulk, multibulk, status, integer, error.
*/
Boris.rules : Object
/*
* Current rule in execution.
*/
Boris.crule : Rule
/*
* Current parser data.
*/
Boris.cdata : Buffer
/*
* Boolean to signal that data is fragmented,
* then another chunk is expected.
*/
Boris.mchk : Boolean
/*
* Current parser position in the data.
*/
Boris.cpos : Number
/*
* Current parser stack for multibulk replies.
*/
Boris.peela : Peela
Arguments within [ ] are optional.
/*
* parse a chunk of data.
*/
Boris#parse( Buffer data ) : undefined
/*
* reset parser state.
*/
Boris#reset() : undefined
/*
* The current executing rule has found a result.
* The convert function argument is an utility that
* scans an array and turns all Buffers into Strings.
*
* NOTE: the boolean 'isError' signals a Redis error reply,
* not a runtime Error.
*/
Boris.on( 'match', function ( Boolean isError, Array result, Function convert ) { .. } )
/*
* A parse error occurred, the parser wasn't able to recognize
* the current control char.
*
* NOTE: on error, parser state ( stack, rules ) will be reset.
*/
Boris.on( 'error', function ( String emsg, Buffer data ) { .. } )
/*
* NOTE: events below are disabled for perfomance reasons.
* If you need them, decomment statements in the code.
*/
/*
* the current executing rule needs further data to continue.
*/
Boris.on( 'miss', function ( Rule rule, Number position ) { .. } )
/*
* Data was totally parsed.
*/
Boris.on( 'end', function () { .. } )
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.
FAQs
Boris a pure javascript parser for the Redis serialization protocol (RESP).
The npm package boris receives a total of 78 weekly downloads. As such, boris popularity was classified as not popular.
We found that boris demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.