buffer

package
v0.0.0-...-e62627f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package buffer provides a QuickJS-native Buffer implementation.

Index

Constants

View Source
const ModuleName = "buffer"

Variables

This section is empty.

Functions

func Bytes

func Bytes(ctx *quickjs.Context, value *quickjs.Value) ([]byte, error)

Bytes returns a copied byte representation of a string or binary value.

func DecodeBytes

func DecodeBytes(ctx *quickjs.Context, value, encoding *quickjs.Value) ([]byte, error)

DecodeBytes copies bytes from a string or binary value using encoding.

func EncodeBytes

func EncodeBytes(ctx *quickjs.Context, data []byte, encoding *quickjs.Value) *quickjs.Value

EncodeBytes returns an encoded string, or a Buffer when encoding is absent.

func InstallGlobal

func InstallGlobal(ctx *quickjs.Context) error

InstallGlobal installs a fresh Buffer constructor on globalThis.

func Module

func Module() module.Definition

Module returns the memory-backed ESM definition for buffer and node:buffer.

func WrapBytes

func WrapBytes(ctx *quickjs.Context, data []byte) *quickjs.Value

WrapBytes creates a Buffer containing a copy of data.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL