bl 0.9.1 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +13 -0
- package/README.md +7 -5
- package/bl.js +6 -1
- package/package.json +5 -5
- package/test/basic-test.js +16 -0
- package/LICENSE +0 -39
package/LICENSE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
=====================
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2014 bl contributors
|
|
5
|
+
----------------------------------
|
|
6
|
+
|
|
7
|
+
*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# bl *(BufferList)*
|
|
2
2
|
|
|
3
|
-
[](http://travis-ci.org/rvagg/bl)
|
|
4
|
-
|
|
5
3
|
**A Node.js Buffer list collector, reader and streamer thingy.**
|
|
6
4
|
|
|
7
5
|
[](https://nodei.co/npm/bl/)
|
|
@@ -169,7 +167,7 @@ console.log(bl.toString())
|
|
|
169
167
|
|
|
170
168
|
--------------------------------------------------------
|
|
171
169
|
<a name="readXX"></a>
|
|
172
|
-
###
|
|
170
|
+
### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
|
|
173
171
|
|
|
174
172
|
All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
|
|
175
173
|
|
|
@@ -188,9 +186,13 @@ See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code><
|
|
|
188
186
|
|
|
189
187
|
* [Rod Vagg](https://github.com/rvagg)
|
|
190
188
|
* [Matteo Collina](https://github.com/mcollina)
|
|
189
|
+
* [Jarett Cruger](https://github.com/jcrugzz)
|
|
191
190
|
|
|
192
191
|
=======
|
|
193
192
|
|
|
194
|
-
|
|
193
|
+
<a name="license"></a>
|
|
194
|
+
## License & copyright
|
|
195
|
+
|
|
196
|
+
Copyright (c) 2013-2014 bl contributors (listed above).
|
|
195
197
|
|
|
196
|
-
|
|
198
|
+
bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
|
package/bl.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var DuplexStream = require('readable-stream')
|
|
1
|
+
var DuplexStream = require('readable-stream/duplex')
|
|
2
2
|
, util = require('util')
|
|
3
3
|
|
|
4
4
|
function BufferList (callback) {
|
|
@@ -52,6 +52,11 @@ BufferList.prototype.append = function (buf) {
|
|
|
52
52
|
var isBuffer = Buffer.isBuffer(buf) ||
|
|
53
53
|
buf instanceof BufferList
|
|
54
54
|
|
|
55
|
+
// coerce number arguments to strings, since Buffer(number) does
|
|
56
|
+
// uninitialized memory allocation
|
|
57
|
+
if (typeof buf == 'number')
|
|
58
|
+
buf = buf.toString()
|
|
59
|
+
|
|
55
60
|
this._bufs.push(isBuffer ? buf : new Buffer(buf))
|
|
56
61
|
this.length += buf.length
|
|
57
62
|
return this
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bl",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
|
|
5
5
|
"main": "bl.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"homepage": "https://github.com/rvagg/bl",
|
|
15
15
|
"authors": [
|
|
16
16
|
"Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
|
|
17
|
-
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)"
|
|
17
|
+
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
|
|
18
|
+
"Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
|
|
18
19
|
],
|
|
19
20
|
"keywords": [
|
|
20
21
|
"buffer",
|
|
@@ -27,9 +28,8 @@
|
|
|
27
28
|
"readable-stream": "~1.0.26"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"tape": "~2.12.3",
|
|
31
|
-
"hash_file": "~0.1.1",
|
|
32
31
|
"faucet": "~0.0.1",
|
|
33
|
-
"
|
|
32
|
+
"hash_file": "~0.1.1",
|
|
33
|
+
"tape": "~4.4.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/test/basic-test.js
CHANGED
|
@@ -336,6 +336,22 @@ tape('test String appendage', function (t) {
|
|
|
336
336
|
t.end()
|
|
337
337
|
})
|
|
338
338
|
|
|
339
|
+
tape('test Number appendage', function (t) {
|
|
340
|
+
var bl = new BufferList()
|
|
341
|
+
, b = new Buffer('1234567890')
|
|
342
|
+
|
|
343
|
+
bl.append(1234)
|
|
344
|
+
bl.append(567)
|
|
345
|
+
bl.append(89)
|
|
346
|
+
bl.append(0)
|
|
347
|
+
|
|
348
|
+
encodings.forEach(function (enc) {
|
|
349
|
+
t.equal(bl.toString(enc), b.toString(enc))
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
t.end()
|
|
353
|
+
})
|
|
354
|
+
|
|
339
355
|
tape('write nothing, should get empty buffer', function (t) {
|
|
340
356
|
t.plan(3)
|
|
341
357
|
BufferList(function (err, data) {
|
package/LICENSE
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
Copyright 2013, Rod Vagg (the "Original Author")
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
MIT +no-false-attribs License
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person
|
|
7
|
-
obtaining a copy of this software and associated documentation
|
|
8
|
-
files (the "Software"), to deal in the Software without
|
|
9
|
-
restriction, including without limitation the rights to use,
|
|
10
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the
|
|
12
|
-
Software is furnished to do so, subject to the following
|
|
13
|
-
conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be
|
|
16
|
-
included in all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
Distributions of all or part of the Software intended to be used
|
|
19
|
-
by the recipients as they would use the unmodified Software,
|
|
20
|
-
containing modifications that substantially alter, remove, or
|
|
21
|
-
disable functionality of the Software, outside of the documented
|
|
22
|
-
configuration mechanisms provided by the Software, shall be
|
|
23
|
-
modified such that the Original Author's bug reporting email
|
|
24
|
-
addresses and urls are either replaced with the contact information
|
|
25
|
-
of the parties responsible for the changes, or removed entirely.
|
|
26
|
-
|
|
27
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
28
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
29
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
30
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
31
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
32
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
33
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
34
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Except where noted, this license applies to any and all software
|
|
38
|
-
programs and associated documentation files created by the
|
|
39
|
-
Original Author, when distributed with the Software.
|