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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rc-js-util

v9.0.9-alpha.65

Published

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

Downloads

106

Readme

rc-js-util

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

Installation

Using npm:

$ npm i --save rc-js-util

Configuration

The global variable _BUILD must be set (to at least an empty object {}) for js-util to function correctly. You can create builds to handle various combinations, e.g. {DEBUG: true, ASAN: true} as required. In production builds it is recommended to use a tool such as uglify-js to strip out debug checks by specifying that _BUILD.DEBUG = false.

For a list of default flags, see IBuildConstants. You can extend this configuration using global interface merging:

declare global
{
    interface IBuildConstants
    {
        MY_CUSTOM_FLAG?: boolean;
    }
}

Usage

Utility functions are provided as both stand alone and grouped by category, e.g. _Array.compactMap and arrayCompactMap are the same.

A collection of standard debug utilities such as assert is provided in _Debug. More specialized cases are exported separately, these are prefixed with Debug. All debug checks should be hidden behind a DEBUG_MODE predicate.

Where an assertion is required in production code these should make use of _Production.

Documentation

See API reference for the latest API docs, for previous versions consult the documentation bundled in the package.

Developing

Building the C++

To see the required version, see the Echo versions step of CI. Recent versions of all tools should build.

  • install emscripten (and use their env utility to set required env vars)
  • install cmake
  • install ninja build

Debugging

To debug the C++ in the browser, you will need to install DevTools DWARF support.

To debug the CTests you'll need vscode with extensions (clion doesn't support this):

  • ms-vscode.cpptools
  • cmake-tools
  • wasm-dwarf-debugging

You should be able to build and use bundled launch config to debug. Synchronous tests require a breakpoint to be put in the JavaScript glue code in callMain. The test fixtures live under cpp/build/{preset}/test/TestFixture.js.

Hints:

  • Enable the CMake Tools extension status bar
  • Leave the kit unspecified
  • Use the cmake presets (they configure the toolchain for you...)
  • Use the address sanitized preset
  • Build the project via npm run build first, it creates other required files