# @xylabs/buffer

[![npm][npm-badge]][npm-link]
[![license][license-badge]][license-link]

> Base functionality used throughout XY Labs TypeScript/JavaScript libraries

## Install

Using npm:

```sh
npm install {{name}}
```

Using yarn:

```sh
yarn add {{name}}
```

Using pnpm:

```sh
pnpm add {{name}}
```

Using bun:

```sh
bun add {{name}}
```


## License

See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).

## Reference

### packages

  ### buffer

    ### .temp-typedoc

      ### index-browser

        ### variables

          ### <a id="Buffer"></a>Buffer

[**@xylabs/buffer**](#../../README)

***

```ts
const Buffer: typeof Buffer;
```

          ### <a id="bufferPolyfill"></a>bufferPolyfill

[**@xylabs/buffer**](#../../README)

***

```ts
const bufferPolyfill: () => void;
```

Polyfills `globalThis.Buffer` with the browser-compatible Buffer implementation if not already defined.

## Returns

`void`

      ### index-node

        ### variables

          ### <a id="Buffer"></a>Buffer

[**@xylabs/buffer**](#../../README)

***

```ts
const Buffer: BufferConstructor;
```

          ### <a id="bufferPolyfill"></a>bufferPolyfill

[**@xylabs/buffer**](#../../README)

***

```ts
const bufferPolyfill: () => void;
```

No-op polyfill for Node.js, where Buffer is already available globally.

## Returns

`void`


[npm-badge]: https://img.shields.io/npm/v/@xylabs/buffer.svg
[npm-link]: https://www.npmjs.com/package/@xylabs/buffer
[license-badge]: https://img.shields.io/npm/l/@xylabs/buffer.svg
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
