Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

beanstalkd-protocol

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beanstalkd-protocol - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

src/default.js

14

package.json
{
"name": "beanstalkd-protocol",
"version": "0.0.1",
"version": "0.1.0",
"description": "Beanstalkd protocol parser for Node.js/Javascript",
"main": "lib/index.js",
"options": {
"mocha": "--require scripts/mocha-bootload --check-leaks --colors --reporter spec"
},
"scripts": {
"test": "mocha"
"prepublish": "npm run check && npm run build",
"check": "npm run lint && npm run test:unit",
"lint": "eslint src",
"build": "rm -rf lib/* && babel src -d lib",
"cover": "NODE_ENV=test istanbul cover _mocha -- $npm_package_options_mocha test/unit/*.test.js test/unit/**/*.test.js",
"test": "npm run test:unit",
"test:unit": "NODE_ENV=test mocha $npm_package_options_mocha test/unit/*.test.js test/unit/**/*.test.js"
},

@@ -25,2 +34,3 @@ "repository": {

"devDependencies": {
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.1",

@@ -27,0 +37,0 @@ "babel-preset-node6": "^11.0.0",

# Beanstalkd protocol parser for Node.js/Javascript
```sh
npm install --save beanstalkd-protocol
```
## Examples
See unit tests
```js
import Protocol from 'beanstalkd-protocol';
```
## API
### protocol.parseCommand(buffer)
Parses a Buffer for a consumer/worker command.
Buffer can be a partial chunk of a stream, the method will return values based on whether or not it has enough information to parse the full command yet.
Will discard command data from put, etc commands.
* **buffer** `Buffer` to parse. Can be a partial chunk of a stream.
* Returns: `[null, {command, args}]` returned if command was the only thing in the chunk
* Returns: `[Buffer, null]` returns passed chunk if no command was found or not enough data was available to fully parse command
* Returns: `[Buffer, {command, args}]` returns remaining part of chunk + found command if chunk is larger than command

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc