Socket
Socket
Sign inDemoInstall

raw-body

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raw-body - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

HISTORY.md

25

index.js

@@ -1,4 +0,6 @@

var StringDecoder = require('string_decoder').StringDecoder
var bytes = require('bytes')
// NOTE: the trailing slash is not a typo
var StringDecoder = require('string_decoder/').StringDecoder
module.exports = function (stream, options, done) {

@@ -118,3 +120,3 @@ if (typeof options === 'function') {

done(null, decoder
? buffer + endStringDecoder(decoder)
? buffer + decoder.end()
: Buffer.concat(buffer)

@@ -151,20 +153,1 @@ )

}
// https://github.com/Raynos/body/blob/2512ced39e31776e5a2f7492b907330badac3a40/index.js#L72
// bug fix for missing `StringDecoder.end` in v0.8.x
function endStringDecoder(decoder) {
if (decoder.end) {
return decoder.end()
}
var res = ""
if (decoder.charReceived) {
var cr = decoder.charReceived
var buf = decoder.charBuffer
var enc = decoder.encoding
res += buf.slice(0, cr).toString(enc)
}
return res
}
{
"name": "raw-body",
"description": "Get and validate the raw body of a readable stream.",
"version": "1.1.6",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com",
"twitter": "https://twitter.com/jongleberry"
},
"version": "1.1.7",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/stream-utils/raw-body.git"
},
"bugs": {
"mail": "me@jongleberry.com",
"url": "https://github.com/stream-utils/raw-body/issues"
},
"repository": "stream-utils/raw-body",
"dependencies": {
"bytes": "1"
"bytes": "1",
"string_decoder": "0.10"
},
"devDependencies": {
"istanbul": "0.2.10",
"mocha": "~1.20.1",
"readable-stream": "~1.0.17",
"co": "3",
"gnode": "~0.0.4",
"mocha": "^1.14.0",
"through2": "~0.4.1",
"request": "^2.27.0",
"assert-tap": "~0.1.4"
"request": ">= 2.36.0 < 3",
"through2": "~0.4.1"
},
"scripts": {
"test": "NODE=gnode make test && node ./test/acceptance.js"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "mocha --reporter spec --bail test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec test/"
}
}

@@ -1,3 +0,7 @@

# Raw Body [![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body)
# raw-body
[![NPM version](https://badge.fury.io/js/method-override.svg)](http://badge.fury.io/js/raw-body)
[![Build Status](https://travis-ci.org/stream-utils/raw-body.svg?branch=master)](https://travis-ci.org/stream-utils/raw-body)
[![Coverage Status](https://img.shields.io/coveralls/stream-utils/raw-body.svg?branch=master)](https://coveralls.io/r/stream-utils/raw-body)
Gets the entire buffer of a stream either as a `Buffer` or a string.

@@ -4,0 +8,0 @@ Validates the stream's length against an expected length and maximum limit.

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