Some nice Crab things implemented in TypeScript.
MIT License
[!WARNING] This project is just something I'm doing for fun. It is not—and may not ever be—meant for use in any serious capacity.
crab-ts
is a TypeScript library that brings RustCrabLang's standard library to the TypeScript ecosystem. This includes the implementation of various Rust features like iterators, chain methods, and useful data structures. The library uses advanced TypeScript features to provide type-safe yet flexible APIs akin to Rust's standard library.
Iterator
trait..chain()
method to chain iterators.IntoIterator
, Clone
, Debug
, Display
, and more.not yet published to npm... coming soon!
StdIterator
serves as the foundational class for all iterators in crab-ts
. It mimics Rust's Iterator
trait and provides several methods to manipulate and query data streams.
import { StdIterator } from 'crab-ts';
class MyIterator extends StdIterator<number> {
// Implementation here
}
Chain
allows you to concatenate two iterators, providing a unified API to iterate through both.
import { StdIterator, Chain } from 'crab-ts';
const iterator1 = new MyIterator();
const iterator2 = new MyIterator();
const chained = new Chain(iterator1, iterator2);
Utilities like Option
, Result
, and IntoIterator
are provided for easier manipulation of data and error handling.
import { Option, Result, IntoIterator } from 'crab-ts';
coming soon!
If you'd like to contribute, please fork the repository and create a pull request, or open an issue for discussion. This project currently uses Bun for development, and relies on it for unit tests.
This project is licensed under the MIT License.