[SignalingServer] Optimize dependent modules
[platform/framework/web/wrtjs.git] / signaling_server / service / node_modules / buffer-alloc-unsafe / readme.md
1 # Buffer Alloc Unsafe
2
3 A [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.
4
5 Works as Node.js: `v7.0.0` <br>
6 Works on Node.js: `v0.10.0`
7
8 ## Installation
9
10 ```sh
11 npm install --save buffer-alloc-unsafe
12 ```
13
14 ## Usage
15
16 ```js
17 const allocUnsafe = require('buffer-alloc-unsafe')
18
19 console.log(allocUnsafe(10))
20 //=> <Buffer 78 0c 80 03 01 00 00 00 05 00>
21
22 console.log(allocUnsafe(10))
23 //=> <Buffer 58 ed bf 5f ff 7f 00 00 01 00>
24
25 console.log(allocUnsafe(10))
26 //=> <Buffer 50 0c 80 03 01 00 00 00 0a 00>
27
28 allocUnsafe(-10)
29 //=> RangeError: "size" argument must not be negative
30 ```
31
32 ## API
33
34 ### allocUnsafe(size)
35
36 - `size` &lt;Integer&gt; The desired length of the new `Buffer`
37
38 Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be
39 less than or equal to the value of `buffer.kMaxLength` and greater than or equal
40 to zero. Otherwise, a `RangeError` is thrown.
41
42 ## See also
43
44 - [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
45 - [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill`
46 - [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from`