Extract the first part of a stream based on a separator
Installation of the npm package:
> npm install --save partial-stream
In this example, the header section of an HTTP response is extracted from the raw response.
import partialStream from 'partial-stream'
const contentStream = rawHttpResponse
.pipe(partialStream('\r\n\r\n', headers => {
console.log(headers)
})
contentStream.pipe(writeStream)# Install dependencies
> npm install
# Run the tests
> npm test
# Continuously compile
> npm run dev
# Continuously run the tests
> npm run dev-test
# Build for production (automatically called by npm install)
> npm run build
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.
ISC © Julien Fontanet
