open-index/open-npm huggingface dataset:
npm package: @scaleforge/async-group
Description: Promise container
Author: ScaleForge
Latest version: 0.1.2

# @scaleforge/async-group
`AsyncGroup` simplifies promise management and ensures proper shutdown synchronization in NodeJS. It allows for storing promises in a shared context and conveniently wait for their settlement. `AsyncGroup` is ideal for background operations and ensuring completion before application shutdown.

## Installation
```
npm install --save @scaleforge/async-group
```
## Usage
```typescript
import AsyncGroup from '@scaleforge/async-group';

const group = new AsyncGroup();

async function asyncOperation() {
  await new Promise((resolve) {
    setTimeout(() => resolve(), Math.floor(Math.random() * 60000 ));
  })
}

async function onApplicationBootstrap() {
  group.add(asyncOperation());
  group.add(asyncOperation());
  group.add(asyncOperation());
}

async function onApplicationShutdown() {
  await group.wait();
}
```
npm package: @scaleforge/joser
Description: Javascript object serializer
Author: ScaleForge
Latest version: 0.8.8

# `joser` (Javascript Object Serializer)

```typescript
const joser = new Joser();

const obj = {
  number: 1,
  string: 'string',
  boolean: true,
  null: null,
  Date: new Date('2023-04-25T00:00:00Z'),
  Buffer: Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]),
};

const serialized = joser.serialize(obj);

assert.deepEqual(serialized, {
  number: 1,
  string: 'string',
  boolean: true,
  null: null,
  Date: 1682380800000,
  Buffer: '00010203040506070809',
  __t: {
    Date: 'Date',
    Buffer: 'Buffer',
  },
});

assert.deepEqual(joser.deserialize(serialized), obj);
```

## Built-in serializers
Joser has built-in serializers for the following NodeJS classes:
- `Date`
- `Buffer`
- `Set`
- `Map`

## Custom serializers
It is also possible to provide custom serializers for custom classes. For example, to serialize the custom class `ObjectId`:
```typescript
const joser = new Joser({
  serializers: [
    {
      type: ObjectId,
      serialize: (value: ObjectId) => value.toString(),
      deserialize: (raw: string) => ObjectId.from(raw),
    },
  ]
});
```
npm package: @scalegate/licensing-web-sdk
Description: Official Web SDK for ScaleGate SaaS License Manager. Browser and server-to-server license validation, domain fingerprinting, feature flags, and periodic health checks.
Author: ScaleGate
Latest version: 1.0.0

# @scalegate/licensing-web-sdk

Official Web SDK for ScaleGate SaaS License Manager. Provides browser and server-to-server license validation, domain fingerprinting, feature flag checks, and periodic health monitoring.

## Install

```bash
npm i @scalegate/licensing-web-sdk
```

## Quick Start (Browser)

```typescript
import { LicenseClient } from '@scalegate/licensing-web-sdk';

const client = new LicenseClient({
  apiUrl: 'https://acme.scalegate.io',
  licenseKey: 'LIC-XXXX-XXXX',
  onValid: (status) => console.log('License valid', status),
  onInvalid: (status) => console.warn('License invalid', status),
});

const result = await client.initialise();
if (result.isValid) {
  // Application is licensed
}
```

## Quick Start (Server-to-Server)

```typescript
import { LicenseClient } from '@scalegate/licensing-web-sdk';

const client = new LicenseClient({
  apiUrl: 'https://api.scalegate.io',
  licenseKey: 'LIC-XXXX-XXXX',
  mode: 's2s',
  validateInterval: 0, // disable periodic validation on the server
});

const result = await client.validate();
console.log(result.isValid, result.daysRemaining);
```

## API Reference

### `new LicenseClient(options)`

Creates a new client instance.

| Option             | Type       | Default      | Description                                      |
|--------------------|------------|--------------|--------------------------------------------------|
| `apiUrl`           | `string`   | **required** | Base URL of the licensing API                    |
| `licenseKey`       | `string`   | **required** | License key to validate                          |
| `appId`            | `string`   | `undefined`  | Optional application ID for multi-app validation |
| `mode`             | `string`   | `'web'`      | `'web'` for browser, `'s2s'` for server-to-server |
| `validateInterval` | `number`   | `300000`     | Periodic validation interval in ms (min 30000)   |
| `onValid`          | `function` | `undefined`  | Callback when periodic validation succeeds       |
| `onInvalid`        | `function` | `undefined`  | Callback when license becomes invalid            |

### `client.initialise(): Promise<LicenseStatus>`

Registers the current domain (browser) or server IP (s2s) and starts periodic validation. Call once at application startup.

### `client.validate(): Promise<LicenseStatus>`

Validates the license against the API without re-registering the domain/IP.

### `client.checkFeatures(featureKeys?: string[]): Promise<FeatureCheckResult>`

Checks feature flags for the current license plan. Pass specific keys or omit to get all features.

### `client.heartbeat(): Promise<boolean>`

Lightweight check that returns `true` if the license is valid. Does not update fingerprints.

### `client.destroy(): void`

Stops periodic validation and cleans up the interval timer.
npm package: @scaleit/devops-jslib-example
Description: Just an example to try out devops CI and npm.
Author: Christian L
Latest version: 1.1.0

# DevOps JSLib Example

Serves as an example to try out devops CI with Node.js and npm. Don't use this please.

## CI

[![CI Node.js Package](https://github.com/SCALEit-eG/devops-jslib-example/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/SCALEit-eG/devops-jslib-example/actions/workflows/npm-publish.yml)
[![npm version](https://badge.fury.io/js/@scaleit%2Fdevops-jslib-example.svg)](https://badge.fury.io/js/@scaleit%2Fdevops-jslib-example)

- First badge created with Github Actions
- Second badge created with [badge.fury.io](https://badge.fury.io/for/js)

## Manual Workflow

Publish an NPM typescript package.

```
npx ts-node example/uselib.ts
npm run build
npm test
npm pack
git commit -m "Commit for version x"
git tag -a <version x> -m "Version x"
git push
git push --tags
npm whoami
npm login
npm publish --access public
```
npm package: @scalejet/capacitor-media-session
Description: A Capacitor plugin that enables Android MediaSession controls with lock screen and background playback support.
Author: Karthik Subburam
Latest version: 0.0.1

# capacitor-media-session

A Capacitor plugin that enables Android MediaSession controls with lock screen and background playback support.

## Install

```bash
npm install capacitor-media-session
npx cap sync
```

## API

<docgen-index>

* [`echo(...)`](#echo)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### echo(...)

```typescript
echo(options: { value: string; }) => Promise<{ value: string; }>
```

| Param         | Type                            |
| ------------- | ------------------------------- |
| **`options`** | <code>{ value: string; }</code> |

**Returns:** <code>Promise&lt;{ value: string; }&gt;</code>

--------------------

</docgen-api>
npm package: @scaleleap/cdk-shared-static-website-hosting
Description: > Creates a shared static website hosting on CloudFront.
Author: Roman Filippov
Latest version: 0.0.2

# Shared Static Website Hosting via AWS CDK

> Creates a shared static website hosting on CloudFront.

## Install

```sh
npm i @scaleleap/cdk-shared-static-website-hosting
```

## Usage

```ts
import { HostedZone } from 'aws-cdk-lib/aws-route53';
import { SharedStaticWebsiteHosting } from '@scaleleap/cdk-shared-static-website-hosting';

const rootZone = HostedZone.fromLookup(scope, 'RootZone', {
  domainName: 'static.example.com',
});

const swp = new SharedStaticWebsiteHosting(scope, 'SharedStaticWebsiteHosting', {
  hostedZone: rootZone,
});
```

## Explanation

The following will be created for you:

- An S3 bucket to store static website files
- A CloudFront distribution to serve the website
- A wilcard `A` DNS record to map sub-domain to the S3 prefix
- An SSL/TLS certificate for the wildcard sub-domain

And the sub-domain will map to the S3 key prefix.

For example:

If you place your static website into:

```plain
s3://my-bucket/foo1/index.html
s3://my-bucket/foo1/image.png
```

The website will be served at:

```plain
https://foo1.static.example.com/
```
npm package: @scaleleap/error
Description: Extendable error object.
Author: Roman Filippov
Latest version: 1.0.0

# @scaleleap/error

> Extendable error class.

## Install

```sh
npm i @scaleleap/error
```

## Usage

```ts
// in ./src/config.ts

import { Error } from '@scaleleap/config'

class MyError extends Error {}

const err = new MyError('Error code: %s', 404)

throw err
```

## Documentation

* Uses `format` from `util` module to format the error message.
* Provides source map support to produce correct source information in the stack trace.
* Highlights error messages in development.

## License

MIT © Scale Leap
npm package: @scaleleap/eslint-config
Description: ESLint config for Scale Leap organization.
Author: Roman Filippov
Latest version: 1.5.0

# @scaleleap/eslint-config

> ESLint config for Scale Leap organization.

## Table of Contents

  - [Table of Contents](#table-of-contents)
  - [Install](#install)
  - [Usage](#usage)
  - [Development](#development)
  - [Maintainers](#maintainers)
  - [Contributing](#contributing)
  - [See Also](#see-also)
  - [License](#license)

## Install

For production use:

```shell
npx install-peerdeps --dev @scaleleap/eslint-config
```

## Usage

Add the following to `package.json`:

```js
{
  "name": "foo",
  // ...

  "eslintConfig": {
    "extends": "@scaleleap"
  },

  // ...
}
```

## Development

### List all rules

To get a list of all of the rules and their origins:

```
npm run index -- index.js
```

### Linking package in development:

```shell
cd some/dir/@scaleleap/eslint-config
npm link                            ## links into global npm dir

cd project/dir
npm link @scaleleap/eslint-config   ## links from global npm dir
```

## Maintainers

 * [@moltar](https://github.com/moltar)
 * [@scaleleap](https://github.com/scaleleap)

## Contributing

If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## See Also

 * Useful ESLint docs:
   * [Shareable Configs](https://eslint.org/docs/developer-guide/shareable-configs)
   * [Configuring ESLint](https://eslint.org/docs/user-guide/configuring)
 * Repo structure was borrowed from [Agoric/eslint-config-jessie](https://github.com/Agoric/eslint-config-jessie)
 * [Awesome ESLint](https://github.com/dustinspecker/awesome-eslint)

## License

MIT © 2019 Scale Leap
npm package: @scaleleap/fastify
Description: Fastify helpers
Author: Roman Filippov
Latest version: 1.0.13

![](https://raw.githubusercontent.com/ScaleLeap/fastify/master/docs/assets/header.png)

📦 @scaleleap/fastify
===================================

Fastify helpers.

---

## Usage

```ts
import { createServer, createRoute, createSchema, typebox } from '../src'
import { createLogger } from '@scaleleap/logger'

const { server, listen } = createServer({
  logger: createLogger(),
})

server.route(
  createRoute(
    // same params as server.route(...)
    {
      method: 'GET',
      url: '/',
      handler: async (req, res) => ({ page: req.query.page }),
    },

    // creates a JSON Schema validator for the request, fully type inferred
    createSchema({
      querystring: typebox.Type.Object({
        page: typebox.Type.Number({ minimum: 1, maximum: 99 }),
      }),
    }),
  ),
)

// has sane defaults for port and address
listen()
```

You can also find the runnable example in [`test/server.ts`](test/server.ts)

## Download & Installation

```sh
$ npm i -s @scaleleap/fastify
```

## Contributing

This repository uses [Conventional Commit](https://www.conventionalcommits.org/) style commit messages.

## Authors or Acknowledgments

* Roman Filippov ([Scale Leap](https://www.scaleleap.com))

## License

This project is licensed under the MIT License.

## Badges

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ScaleLeap/fastify/CI)](https://github.com/ScaleLeap/fastify/actions)
[![NPM](https://img.shields.io/npm/v/@scaleleap/fastify)](https://npm.im/@scaleleap/fastify)
[![License](https://img.shields.io/npm/l/@scaleleap/fastify)](./LICENSE)
[![Coveralls](https://img.shields.io/coveralls/github/scaleleap/fastify)](https://coveralls.io/github/ScaleLeap/fastify)
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
npm package: @scaleleap/puppeteer
Description: ![](https://raw.githubusercontent.com/ScaleLeap/puppeteer/master/docs/assets/header.png)
Author: Roman Filippov
Latest version: 1.1.56

![](https://raw.githubusercontent.com/ScaleLeap/puppeteer/master/docs/assets/header.png)

📦 @scaleleap/puppeteer
===================================

A Puppeteer convenience wrapper with stealth mode enabled by default.

---

## Download & Installation

```sh
$ npm i -s @scaleleap/puppeteer
```

## Usage

Exports everything the same as `puppeteer-core` package.

In addition to that, `launch` method is amended to include an `extra` option that can enable or
disable `puppeteer-extra` behavior.

Also `executablePath` is set, and `headless` is set via `PUPPETEER_HEADLESS` environment variable.

```ts
import { launch } from '@scaleleap/puppeteer'

const await browser = launch({
  extra: {
    // is true by default, but we are just showing the example
    stealth: true
  }
})

```

## Helper Functions

### clickAndWait(page: Page, selector: string, clickOptions?: ClickOptions, navigationOptions?: NavigationOptions)

Clicks and waits for network request to complete and resolves.

## Environment Variables

The following environment variables are available:

 * `PUPPETEER_EXECUTABLE_PATH` - the location of the Puppeteer executable.
 * `GOOGLE_CHROME_BIN` - same as above, but only used inside Heroku buildpack.
 * `PUPPETEER_HEADLESS` - Whether or not it should run in headless mode. Default: `true`

## Heroku

For Heroku deployments, use a [`heroku/google-chrome` buildpack](https://github.com/heroku/heroku-buildpack-google-chrome).

This package will get the Chrome locations from the environment variable provided by the buildpack.

```sh
## make sure we are using NodeJS
heroku buildpacks:set heroku/nodejs

## now add chrome buildpack
heroku buildpacks:add heroku/google-chrome
```

## References

* [Puppeteer Docs](https://pptr.dev/)
* [Puppeteer API](https://github.com/puppeteer/puppeteer/blob/master/docs/api.md)
* [List of Chromium Command Line Switches](https://peter.sh/experiments/chromium-command-line-switches/)

## Contributing

This repository uses [Conventional Commit](https://www.conventionalcommits.org/) style commit messages.

## Authors or Acknowledgments

* Roman Filippov ([Scale Leap](https://www.scaleleap.com))

## License

This project is licensed under the MIT License.

## Badges

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ScaleLeap/puppeteer/CI)](https://github.com/ScaleLeap/puppeteer/actions)
[![NPM](https://img.shields.io/npm/v/@scaleleap/puppeteer)](https://npm.im/@scaleleap/puppeteer)
[![License](https://img.shields.io/npm/l/@scaleleap/puppeteer)](./LICENSE)
[![Coveralls](https://img.shields.io/coveralls/github/scaleleap/puppeteer)](https://coveralls.io/github/ScaleLeap/puppeteer)
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
npm package: @scaleleap/renovate-config
Description: Renovate shareable config presets
Author: Roman Filippov
Latest version: 1.8.0

![](https://raw.githubusercontent.com/ScaleLeap/renovate-config/master/docs/assets/header.png)

📦 @scaleleap/renovate-config
===================================

[Renovate](https://docs.renovatebot.com/) [shareable config presets](https://docs.renovatebot.com/config-presets/).

---

## Installation

Create a `renovate.json` in your project root, with the following:

```json
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "@scaleleap"
  ]
}
```

## Contributing

1. Create or edit a preset in `src/presets/*.ts`
2. Run `npm start` to commit changes to `package.json`
3. Run `npm t` for tests

This repository uses [Conventional Commit](https://www.conventionalcommits.org/) style commit messages.

Use [Configuration Options](https://docs.renovatebot.com/configuration-options/) for reference.

## Authors or Acknowledgments

* Roman Filippov ([Scale Leap](https://www.scaleleap.com))

## License

This project is licensed under the MIT License.

## Badges

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ScaleLeap/renovate-config/Test)](https://github.com/ScaleLeap/renovate-config/actions)
[![NPM](https://img.shields.io/npm/v/@scaleleap/renovate-config)](https://npm.im/@scaleleap/renovate-config)
[![License](https://img.shields.io/npm/l/@scaleleap/renovate-config)](./LICENSE)
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)