# Bebop TypeScript Runtime

[![npm version](https://img.shields.io/npm/v/bebop.svg)](https://www.npmjs.com/package/bebop)
[![npm downloads](https://img.shields.io/npm/dm/bebop.svg)](https://www.npmjs.com/package/bebop)
[![GitHub license](https://img.shields.io/github/license/betwixt-labs/bebop.svg)](https://github.com/betwixt-labs/bebop/blob/main/LICENSE)

The official [Bebop](https://github.com/betwixt-labs/bebop) runtime for TypeScript and JavaScript.

## Overview

This package provides the essential runtime components for using Bebop-generated code in TypeScript and JavaScript projects. It enables blazing fast, typesafe binary serialization with minimal overhead.

## Features

- 🚀 High-performance binary serialization
- 📦 Tiny runtime footprint
- 🔒 Type-safe operations
- 🌐 Works everywhere: Node.js, browsers, serverless platforms, and more
- 🍃 Zero dependencies
- 🏋️ Lightweight - minimal impact on your bundle size
- 🧰 Provides runtime types for enhanced type safety
- 🔧 Supports dynamic encoding/decoding with binary schemas

## Installation

```bash
npm install bebop
```

## Usage

While the Bebop TypeScript runtime is primarily used with code generated by `bebopc`, it also provides useful types and utilities for direct use in your code.

Example usage with generated code:

```typescript
import { Person } from './generated/schema';

const person = new Person({
    name: "Spike Spiegel",
    age: 27
});

// Encode to binary
const encoded = person.encode();

// Decode from binary
const decoded = Person.decode(encoded);
```

For more advanced use cases, such as dynamic encoding/decoding with binary schemas, refer to our [Binary Schema documentation](https://docs.bebop.sh/reference/binary-schema/).

## Documentation

For comprehensive documentation and guides, visit:

- [Getting Started with TypeScript](https://docs.bebop.sh/guide/getting-started-typescript/)
- [Bebop Documentation](https://docs.bebop.sh)
- [Binary Schema Reference](https://docs.bebop.sh/reference/binary-schema/)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

Bebop is open-source software licensed under the Apache License.

For more information about Bebop, visit [bebop.sh](https://bebop.sh).