beanstalkd-protocol
Advanced tools
Comparing version 0.0.1 to 0.1.0
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
21722
11
400
30
11