open-index/open-npm huggingface dataset:
npm package: @palasimi/workers
Description: Promise-based request-response API for dedicated web workers
Author: Levi Gruspe
Latest version: 1.0.1

# palasimi-workers

Promise-based request-response API for dedicated web workers.

## Installation

```bash
npm i @palasimi/workers
```

## Usage

```typescript
// worker.ts, compiles to /dist/worker.js
import { initServer } from "@palasimi/workers";

initServer({
  ping: () => "pong",
  pong: () => "ping",
  add: (xs) => xs.reduce((x, y) => x + y),
});

// index.ts
import { initClient } from "@palasimi/workers";

const worker = new Worker("/dist/worker.js");
const call = initClient(worker);

call({ name: "ping" }).then(console.log);
// {id: 1, name: 'ping', value: 'pong', status: 2}

call({ name: "pong" }).then(console.log);
// {id: 2, name: 'pong', value: 'ping', status: 2}

call({ name: "add", value: [1, 2, 3, 4, 5] }).then(console.log);
// {id: 3, name: 'add', value: 15, status: 2}
```

## License

[MIT](./LICENSE)
npm package: @palastri/eslint-plugin
Description: ESLint plugin from personal taste of Palastri maintainer
Author: Imam S Rifkan
Latest version: 1.0.0

# eslint-plugin

[![Build Status](https://github.com/palastri/eslint-plugin/workflows/Release/badge.svg?branch=main)](https://github.com/palastri/eslint-plugin/actions/workflows/production.yml)

## Installation

```bash
yarn add --dev eslint @palastri/eslint-plugin
```

## Usage

Add `@palastri` to the plugins section of your `.eslintrc` configuration file.

```json
{
  "extends": ["@palastri/recommended"],
  "plugins": ["@palastri"]
}
```

## Shareable configurations

### Recommended

This plugin exports a recommended configuration that enforces good testing practices.
To enable this configuration, please use the `extends` property in the `.eslintrc` config file:

```json
{
  "extends": ["plugin:@palastri/recommended"]
}
```

### Stylistic

This plugin also exports a configuration named `stylistic`, which adds some extra stylistic rules. The rules considered to be best practice for modern TypeScript codebase, but that do not impact program logic.
To enable this configuration, please use the `extends` property in the `.eslintrc` config file:

```json
{
  "extends": ["plugin:@palastri/recommended", "plugin:@palastri/stylistic"]
}
```

## Recommended plugin ruleset

This plugin includes the following plugins:

- [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint)
- [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)
- [eslint-plugin-eslint-plugin](https://github.com/eslint-community/eslint-plugin-eslint-plugin)
- [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import)
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
- [eslint-plugin](https://github.com/jsx-eslint/eslint-plugin)

One or more default rules from those plugins are overridden such as:

| Name                                 | Description                                                       | Rules                                                                                    |
| :----------------------------------- | :---------------------------------------------------------------- | :--------------------------------------------------------------------------------------- |
| `@typescript-eslint/array-type`      | Require consistently using either `T[]` or `Array<T>` for arrays. | `["error", { default: "array-simple" }]`                                                 |
| `@typescript-eslint/member-ordering` | Require a consistent member declaration order.                    | `["error", { default: { optionallyOrder: "required-first", order: "alphabetically" } }]` |                                                                                |

## Changelog

Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md)