time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (5384B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2021 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # Buffer
     22 
     23 [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
     24 
     25 > Buffer namespace.
     26 
     27 <section class="installation">
     28 
     29 ## Installation
     30 
     31 ```bash
     32 npm install @stdlib/buffer
     33 ```
     34 
     35 </section>
     36 
     37 <section class="usage">
     38 
     39 ## Usage
     40 
     41 ```javascript
     42 var ns = require( '@stdlib/buffer' );
     43 ```
     44 
     45 #### ns
     46 
     47 Buffer namespace.
     48 
     49 ```javascript
     50 var o = ns;
     51 // returns {...}
     52 ```
     53 
     54 The namespace contains the following:
     55 
     56 <!-- <toc pattern="*"> -->
     57 
     58 <div class="namespace-toc">
     59 
     60 -   <span class="signature">[`allocUnsafe( size )`][@stdlib/buffer/alloc-unsafe]</span><span class="delimiter">: </span><span class="description">allocate a buffer having a specified number of bytes.</span>
     61 -   <span class="signature">[`Buffer()`][@stdlib/buffer/ctor]</span><span class="delimiter">: </span><span class="description">buffer constructor.</span>
     62 -   <span class="signature">[`arraybuffer2buffer( buf[, byteOffset[, length]] )`][@stdlib/buffer/from-arraybuffer]</span><span class="delimiter">: </span><span class="description">allocate a buffer from an ArrayBuffer.</span>
     63 -   <span class="signature">[`copyBuffer( buffer )`][@stdlib/buffer/from-buffer]</span><span class="delimiter">: </span><span class="description">copy buffer data to a new `Buffer` instance.</span>
     64 -   <span class="signature">[`string2buffer( str[, encoding] )`][@stdlib/buffer/from-string]</span><span class="delimiter">: </span><span class="description">allocate a buffer containing a provided string.</span>
     65 -   <span class="signature">[`reviver( key, value )`][@stdlib/buffer/reviver]</span><span class="delimiter">: </span><span class="description">revive a JSON-serialized Buffer.</span>
     66 -   <span class="signature">[`toJSON( buffer )`][@stdlib/buffer/to-json]</span><span class="delimiter">: </span><span class="description">return a JSON representation of a Buffer.</span>
     67 
     68 </div>
     69 
     70 <!-- </toc> -->
     71 
     72 </section>
     73 
     74 <!-- /.usage -->
     75 
     76 <section class="examples">
     77 
     78 ## Examples
     79 
     80 <!-- TODO: better examples -->
     81 
     82 <!-- eslint no-undef: "error" -->
     83 
     84 ```javascript
     85 var objectKeys = require( '@stdlib/utils/keys' );
     86 var ns = require( '@stdlib/buffer' );
     87 
     88 console.log( objectKeys( ns ) );
     89 ```
     90 
     91 </section>
     92 
     93 <!-- /.examples -->
     94 
     95 
     96 <section class="main-repo" >
     97 
     98 * * *
     99 
    100 ## Notice
    101 
    102 This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
    103 
    104 For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
    105 
    106 #### Community
    107 
    108 [![Chat][chat-image]][chat-url]
    109 
    110 ---
    111 
    112 ## License
    113 
    114 See [LICENSE][stdlib-license].
    115 
    116 
    117 ## Copyright
    118 
    119 Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
    120 
    121 </section>
    122 
    123 <!-- /.stdlib -->
    124 
    125 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    126 
    127 <section class="links">
    128 
    129 [npm-image]: http://img.shields.io/npm/v/@stdlib/buffer.svg
    130 [npm-url]: https://npmjs.org/package/@stdlib/buffer
    131 
    132 [test-image]: https://github.com/stdlib-js/buffer/actions/workflows/test.yml/badge.svg
    133 [test-url]: https://github.com/stdlib-js/buffer/actions/workflows/test.yml
    134 
    135 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/buffer/main.svg
    136 [coverage-url]: https://codecov.io/github/stdlib-js/buffer?branch=main
    137 
    138 [dependencies-image]: https://img.shields.io/david/stdlib-js/buffer.svg
    139 [dependencies-url]: https://david-dm.org/stdlib-js/buffer/main
    140 
    141 [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
    142 [chat-url]: https://gitter.im/stdlib-js/stdlib/
    143 
    144 [stdlib]: https://github.com/stdlib-js/stdlib
    145 
    146 [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
    147 
    148 [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/buffer/main/LICENSE
    149 
    150 <!-- <toc-links> -->
    151 
    152 [@stdlib/buffer/alloc-unsafe]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/alloc-unsafe
    153 
    154 [@stdlib/buffer/ctor]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/ctor
    155 
    156 [@stdlib/buffer/from-arraybuffer]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/from-arraybuffer
    157 
    158 [@stdlib/buffer/from-buffer]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/from-buffer
    159 
    160 [@stdlib/buffer/from-string]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/from-string
    161 
    162 [@stdlib/buffer/reviver]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/reviver
    163 
    164 [@stdlib/buffer/to-json]: https://www.npmjs.com/package/@stdlib/buffer/tree/main/to-json
    165 
    166 <!-- </toc-links> -->
    167 
    168 </section>
    169 
    170 <!-- /.links -->