open-index/open-npm huggingface dataset:
npm package: @openfeature/config-cat-core
Description: The core implementation of ConfigCat providers. This is a shared core package. Application developers should use one of the more specific providers instead:
Latest version: 0.2.2

# ConfigCat Core

The core implementation of ConfigCat providers.
This is a shared core package. Application developers should use one of the more specific providers instead:

- For web/browser applications, use [@openfeature/config-cat-web-provider](https://www.npmjs.com/package/@openfeature/config-cat-web-provider).
- For server-side (Node.js) applications, use [@openfeature/config-cat-provider](https://www.npmjs.com/package/@openfeature/config-cat-provider).
npm package: @openfeature/core
Description: Shared OpenFeature JS components (server and web)
Latest version: 1.9.2

<!-- markdownlint-disable MD033 -->
<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/open-feature/community/0e23508c163a6a1ac8c0ced3e4bd78faafe627c7/assets/logo/horizontal/white/openfeature-horizontal-white.svg" />
    <img align="center" alt="OpenFeature Logo" src="https://raw.githubusercontent.com/open-feature/community/0e23508c163a6a1ac8c0ced3e4bd78faafe627c7/assets/logo/horizontal/black/openfeature-horizontal-black.svg" />
  </picture>
</p>

<h2 align="center">Shared js components (server and web)</h2>

[OpenFeature](https://openfeature.dev) is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool.

## 🔩 Shared JS components

> [!IMPORTANT]  
> If you're developing a provider or hook, you probably do not want to use this package!

This package comprises the common types and interfaces of the OpenFeature server and web SDKs.
If you are developing a provider or a hook, you should instead utilize the [server](../server/README.md) or [web](../client/README.md) SDKs.
This package is useful if you need to reference the underlying types common to all the JS SDKs or if you're creating a utility that can be used for both server and web implementations.
Be sure to add this module as either a `devDependency` (if only build time assets such as types are required) or as a `peerDependency` with a permissive version expression.

### API Reference

See [here](https://open-feature.github.io/js-sdk/modules/_openfeature_core.html) for the complete API documentation.
npm package: @openfeature/debounce-hook
Description: This is a utility "meta" hook, which can be used to effectively debounce or rate limit other hooks based on various parameters. This can be especially useful for certain UI frameworks and SDKs that frequently re-render and re-evaluate flags (React, Angula
Latest version: 0.1.1

# Debounce Hook

This is a utility "meta" hook, which can be used to effectively debounce or rate limit other hooks based on various parameters.
This can be especially useful for certain UI frameworks and SDKs that frequently re-render and re-evaluate flags (React, Angular, etc).

## Installation

```
$ npm install @openfeature/debounce-hook
```

### Peer dependencies

This package only requires the `@openfeature/core` dependency, which is installed automatically no matter which OpenFeature JavaScript SDK you are using.

## Usage

Simply wrap your hook with the debounce hook by passing it as a constructor arg, and then configure the remaining options.
In the example below, we wrap a logging hook.
This debounces all its stages, so it only logs a maximum of once a minute for each flag key, no matter how many times that flag is evaluated.

```ts
const debounceHook = new DebounceHook(loggingHook, {
  debounceTime: 60_000,             // how long to wait before the hook can fire again
  maxCacheItems: 100,               // max amount of items to keep in the cache; if exceeded, the oldest item is dropped
});

// add the hook globally
OpenFeature.addHooks(debounceHook);

// or at a specific client
client.addHooks(debounceHook);
```

The hook maintains a simple expiring cache with a fixed max size and keeps a record of recent evaluations based on an optional key-generation function (cacheKeySupplier).
Be default, the key-generation function is purely based on the flag key.
Particularly in server use-cases, you may want to take the targetingKey or other contextual information into account in your debouncing.
Below we see an example using this, as well as other advanced options:

```ts
const debounceHook = new DebounceHook<string>(loggingHook, {
  cacheKeySupplier: (flagKey, context) => flagKey + context.targetingKey, // cache on a combination of user and flag key
  debounceTime: 60_000, // debounce for 60 seconds (per user due to our cacheKeySupplier above)
  maxCacheItems: 1000,  // cache a maximum of 1000 records
  cacheErrors: false,   // don't debounce errors; always re-run if the last run threw 
  logger: console,      // optional logger
});
```

## Development

### Building

Run `nx package hooks-debounce` to build the library.

### Running unit tests

Run `nx test hooks-debounce` to execute the unit tests via [Jest](https://jestjs.io).