source: node_modules/simple-concat/index.js@ 81bc7da

finki-main main
Last change on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 392 bytes
Line 
1/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
2module.exports = function (stream, cb) {
3 var chunks = []
4 stream.on('data', function (chunk) {
5 chunks.push(chunk)
6 })
7 stream.once('end', function () {
8 if (cb) cb(null, Buffer.concat(chunks))
9 cb = null
10 })
11 stream.once('error', function (err) {
12 if (cb) cb(err)
13 cb = null
14 })
15}
Note: See TracBrowser for help on using the repository browser.