npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

typerust

v0.5.2

Published

A library that provides Rust types in TypeScript.

Downloads

156

Readme

typerust

A library that provides Rust types in TypeScript. This library contains TypeScript implementations of the following Rust types: Result, Option, HashMap, and HashSet.

Installation

# deno
deno add npm:typerust
# npm
npm install --save-dev typerust

Usage

Result

import { Result } from "typerust";

const success = Result.Ok(42);
const failure = Result.Err("something went wrong");

if (success.isOk()) console.log(success.unwrap());

const fromPromise = Result.from(Promise.resolve(100));

Option

import { Option } from "typerust";

const some = Option.Some(10);
const none = Option.None;

if (some.isSome()) console.log(some.unwrap());

const fromNullable = Option.from(null);

HashMap

import { HashMap } from "typerust";

const map = HashMap.from({ key: "value" });
const entry = map.get("key");

if (entry) console.log(entry.value);

HashSet

import { HashSet } from "typerust";

const set = HashSet.from([1, 2, 3]);
const exists = set.contains(2);

if (exists) console.log("Found 2");

Project layout

src/
├── hashmap/       # Rust-like HashMap.
├── hashset/       # Rust-like HashSet.
├── option/        # Option type (Some/None).
├── result/        # Result type (Ok/Err).
└── mod.ts         # Main entry point.

Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/name).
  3. Ensure all code passes deno task lint.
  4. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.