open-index/open-npm huggingface dataset:
npm package: @faustt/release
Description: <div align="center">
Latest version: 0.11.2

<div align="center">

# @faustt/release

Simple release management.

[![Release](https://github.com/faustt/release/actions/workflows/release.yml/badge.svg)](https://github.com/faustt/release/actions/workflows/release.yml)

</div>

## Introduction

This command line tool provides a unified release process for Node.js packages.

## Features

### Semantic release

The tool bumps your version according to [semantic release](https://github.com/semantic-release/semantic-release) guidelines. Your commits are analyzed using an extended [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) syntax to determine the version bump. See [anaylzeCommits.ts](./src/git/analyzeCommits.ts) for more information.

To specify a custom initial version (instead of 0.1.0), specify it inside your package.json:

```json
{
  "release": {
    "initialVersion": "2.0.0"
  }
}
```

### GitHub release generation

The tool automatically creates a github release with a changelog generated from your commits. All directories in the "bin" folder of your repository are automatically added as a zipped asset. If the directory name contains $version, it is replaced with the current version.

## Usage

Add the package:

```bash
yarn add -D @faustt/release
```

Run this in your CI pipeline:

```bash
yarn release
```

To get the current version, run the following:

```bash
yarn release --current-version
```

To get the next version, run the following:

```bash
yarn release --next-version
# or (alias)
yarn release --new-version
```

To get only the changelog as markdown, run the following:

```bash
yarn release --changes-markdown
```
npm package: @faustt/rpc
Description: Easy to use RPC library for Node.JS and browsers using WebSockets.
Latest version: 1.0.1

# @faustt/rpc

Easy to use RPC library for Node.JS and browsers using WebSockets.

## Example

Server code for Node.js:

```typescript
import { createServer } from "@faustt/rpc";

async function main() {
  const server = await createServer();
  console.log(`Available on ${server.url}`);

  server.method("sayHello", () => {
    console.log("Hello world!");
  });

  server.method("sum", (a: number, b: number) => a + b);

  const numbers = server.channel("numbers");

  server.method("pushRandomNumbers", async (amount: number) => {
    for (let i = 0; i < amount; ++i) {
      await new Promise((resolve) => setTimeout(resolve, 500));
      numbers.push(Math.random());
    }
  });
}

main();
```

Client code for both Node.js and browsers:

```typescript
import { createClient } from "@faustt/rpc";

async function main() {
  const client = await createClient(/* server.url */);

  // server prints "Hello world!"
  await client.call("sayHello");

  console.log(await client.call("sum", 4, 5)); // 9

  client.subscribe("numbers", (num: number) => {
    console.log(num);
  });

  // will eventually print 5 random numbers
  await client.call("pushRandomNumbers", 5);
}

main();
```

## Features

### Secure servers

You can setup a secure server by just enabling a flag. A self signed certificate
will be generated for the server to use. Note that for browser use, the user
has to trust the generated certificate. This can be done by instructing the user
to visit `server.trustUrl`. This will display the browser warning. Once the user
has trusted the certificate, they will be redirected to the previous page.

```typescript
// Generate self signed certificate
const server = await createServer({ secure: true });

// Use existing certificate
const server = await createServer({ secure: {
  key: await fs.readFile(/*...*/, "utf8"),
  cert: await fs.readFile(/*...*/, "utf8"),
} });
```