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

@freik/ts-cpp-tooling

v0.6.2

Published

A simple IDL for use with CrowCpp (C++) and TypeScript

Downloads

678

Readme

ts-cpp-tooling

This is my set of TS/C++ tools (specifically for dealing with projects that involve both)

crow-idl

An intentionally restrictive IDL for generating types in C++ and Typescript with support for automatic converson to and from CrowCpp's JSON types.

Use it by running

bunx --package="@freik/ts-cpp-tooling" crow-idl <args>

or

npx --package="@freik/ts-cpp-tooling" crow-idl <args>

This is mostly just used by Cuark for creation of light-weight web-UI, local logic apps (instead of Electron). I'm using Cuark for my Cassette Music Player project, currently.

Basically, you define your types (in a simple Typescript-hosted IDL) and crow-idl will generate both Typescript and C++ files for marshalling & unmarshalling the types as CrowCpp's JSON types.

The types:

This supports all the std:: integer types. Note that 64 bit values translate to JavaScript BigInt values (because that's what's necessary). It also supports strings, 'simple' objects, arrays (as std::vectors), tuples, optional fields (as std::optional's), and maps and sets (as either std::map/std::set or std::unordered_map/std::unordered_set).

| crow-idl type | TypeScript | C++ | | ------------------------- | --------------------------- | --------------------------------------- | | u8() | number | std::uint8_t | | i8() | number | std::int8_t | | u16() | number | std::uint16_t | | i16() | number | std::int16_t | | u32() | number | std::uint32_t | | i32() | number | std::int32_t | | u64() | BigInt | std::uint64_t | | i64() | BigInt | std::int64_t | | flt() | number | float | | dbl() | number | double | | chr() | string | char | | str() | string | std::string (Should be string_u8?) | | bool() | boolean | bool | | arr(T) | T[] | std::vector<T> | | tup(...T) | [...T] | std::tuple<...T> | | opt(T) | T? | std::optional<T> | | set(T) | Set<T> | std::set<T> | | fset(T) | Set<T> | std::unordered_set<T> | | map(K,V) | Map<K,V> | std::map<K,V> | | fmap(K,V) | Map<K,V> | std::unordered_map<K,V> | | obj({Keys:Types}) | {Keys...: Types...} | struct { Types Keys...} | | sub(ref, {Keys: Types}) | ref & {Keys...: Types...} | struct : public ref { Types Keys... } |

TODO: Document enum_lst, enum_num, and enum_str, plus ref.

To use this in C++, you'll need both the generated header, as well as the json_pickling.hpp header file which can be found in the build subdirectory. (TODO: maybe generate that header? Inline or as an external header?)

Notes:

  • ref is more restrictive that most other stuff, in that you cannot have a ref to anything that requires 'deep' understanding of it's content. At this writing, I believe that means you can't have a ref to an opt type. (What you probably want is an opt to a ref type)

  • opt types don't (and probably shouldn't) nest. An opt to an opt to an opt (should) flatten out. TODO: I think maybe this should be an error when the user tries it.

TODO's

  • [ ] Document the core IDL. Current examples are insufficient.

  • [ ] Document the command line better. It's not complicated, but it's not obvious, either.

  • [ ] Add support for a different JSON library, because Crow's JSON library leaves a lot to be desired

ts-class-graph

Create a mermaid class graph from Typescript types & interfaces. This is very clunky, shockingly untested, but I'm using it to document TS code that I'm converting over to C++.

bunx --package="@freik/ts-cpp-tooling" ts-class-graph <optional path to tsconfig.json>