time-to-botec/js/node_modules/@stdlib/buffer/to-json/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

31 lines
580 B
Plaintext

{{alias}}( buffer )
Returns a JSON representation of a buffer.
The returned JSON object has the following properties:
- type: value type
- data: buffer data as a generic array
Parameters
----------
buffer: Buffer
Buffer to serialize.
Returns
-------
out: Object
JSON representation.
Examples
--------
> var buf = new {{alias:@stdlib/buffer/alloc-unsafe}}( 2 );
> buf[ 0 ] = 1;
> buf[ 1 ] = 2;
> var json = {{alias}}( buf )
{ 'type': 'Buffer', 'data': [ 1, 2 ] }
See Also
--------