29 lines
508 B
Plaintext
29 lines
508 B
Plaintext
|
|
{{alias}}( str[, encoding] )
|
|
Allocates a buffer containing a provided string.
|
|
|
|
Parameters
|
|
----------
|
|
str: string
|
|
Input string.
|
|
|
|
encoding: string (optional)
|
|
Character encoding. Default: 'utf8'.
|
|
|
|
Returns
|
|
-------
|
|
out: Buffer
|
|
Buffer instance.
|
|
|
|
Examples
|
|
--------
|
|
> var b = {{alias}}( 'beep boop' )
|
|
<Buffer>
|
|
> b = {{alias}}( '7468697320697320612074c3a97374', 'hex' );
|
|
> b.toString()
|
|
'this is a tést'
|
|
|
|
See Also
|
|
--------
|
|
|