open-index/open-npm huggingface dataset:
npm package: @joshuaavalon/cheerio-table-parser
Description: Parsing table element of Cheerio into 2D array.
Author: Joshua Avalon
Latest version: 2.0.3

# Cheerio Table Parser

[![License][license_badge]][license] [![Pipelines][pipelines_badge]][pipelines] [![Coverage][coverage_badge]][pipelines] [![NPM][npm_badge]][npm]

Parsing table element of Cheerio into 2D array.

## Installation

```
npm install @joshuaavalon/cheerio-table-parser
```

## Usage

```typescript
import cheerio from "cheerio";
import { parseTable } from "@joshuaavalon/cheerio-table-parser";

const dom = cheerio.load(html);
table = parseTable(dom("table")[0], {
  parser: (element) => cheerio(element).text(),
});

/*
[
  ["A", "B", "C", "D", "E"],
  ["1a", "2a", "3a", "4a", "5a"],
  ["1a", "2b", "2b", "4b", "5b"],
  ["1a", "2b", "2b", "4c", "5c"],
  ["1a", "2d", "3d", "4c", "5d"],
  ["1a", "2d", "3e", "4e", "5e"]
]
*/
```

## Known Issues

### Overlapping Cell

According to [HTML table specifications][table], it depends on how user agent render the table. Most browsers render it as overlapping cell.

However, this is not possible in this library. Therefore, it will favour `rowspan` over `colspan`.

### Handle thead, tbody, tfoot

`<thead>`, `<tbody>`, `<tfoot>` should be handled separately. This is not consider in this library. However, you can pass in `<tbody>` instead of `<table>` separately.

[license]: https://gitlab.com/joshua-avalon/cheerio-table-parser/blob/master/LICENSE
[license_badge]: https://img.shields.io/badge/license-Apache--2.0-green.svg
[pipelines]: https://gitlab.com/joshua-avalon/cheerio-table-parser/pipelines
[pipelines_badge]: https://gitlab.com/joshua-avalon/cheerio-table-parser/badges/master/pipeline.svg
[coverage_badge]: https://gitlab.com/joshua-avalon/cheerio-table-parser/badges/master/coverage.svg
[npm]: https://www.npmjs.com/package/@joshuaavalon/cheerio-table-parser
[npm_badge]: https://img.shields.io/npm/v/@joshuaavalon/cheerio-table-parser/latest.svg
[table]: https://www.w3.org/TR/html401/struct/tables.html#h-11.2.6.1
npm package: @joshuaavalon/cloudflare-dns-api
Description: Cloudflare DDNS api wrapper.
Author: Joshua Avalon
Latest version: 1.1.6

# @joshuaavalon/cloudflare-dns-api

[![License][license_badge]][license] [![Pipelines][pipelines_badge]][pipelines] [![Coverage][coverage_badge]][pipelines] [![NPM][npm_badge]][npm] [![semantic-release][semantic_release_badge]][semantic_release]

Cloudflare DDNS api wrapper.

## Installation

```
npm i @joshuaavalon/cloudflare-dns-api
```

[license]: https://gitlab.com/joshuaavalon/cloudflare-dns-api/blob/master/LICENSE
[license_badge]: https://img.shields.io/badge/license-Apache--2.0-green.svg
[pipelines]: https://gitlab.com/joshuaavalon/cloudflare-dns-api/pipelines
[pipelines_badge]: https://gitlab.com/joshuaavalon/cloudflare-dns-api/badges/master/pipeline.svg
[coverage_badge]: https://gitlab.com/joshuaavalon/cloudflare-dns-api/badges/master/coverage.svg
[npm]: https://www.npmjs.com/package/@joshuaavalon/cloudflare-dns-api
[npm_badge]: https://img.shields.io/npm/v/@joshuaavalon/cloudflare-dns-api/latest.svg
[semantic_release]: https://github.com/semantic-release/semantic-release
[semantic_release_badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
npm package: @joshuaavalon/eslint-config-javascript
Description: Shareable ESLint JavaScript config.
Author: Joshua Avalon
Latest version: 11.0.3

# @joshuaavalon/eslint-config-javascript

This is the opinionated ESLint configuration repository that used by myself.
Not support is guaranteed. Use as your own risk.

This configuration include both lint and format rules which may cause conflicts with other formatter like Prettier.

> For <10.0.0, please check https://github.com/joshuaavalon/eslint-config.

## Getting Started

```
npm i -D eslint @joshuaavalon/eslint-config-javascript
```

```js
// eslint.config.js
import globals from "globals";
import jsConfig from "@joshuaavalon/eslint-config-javascript";

{
  ...jsConfig,
  ignores: ["node_modules", "dist"],
  files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
  languageOptions: {
    globals: { ...globals.node }
  }
}
```
npm package: @joshuaavalon/eslint-config-react
Description: Shareable ESLint React config.
Author: Joshua Avalon
Latest version: 10.0.0

# @joshuaavalon/eslint-config-react

This is the opinionated ESLint configuration repository that used by myself.
Not support is guaranteed. Use as your own risk.

This configuration include both lint and format rules which may cause conflicts with other formatter like Prettier.

## Getting Started

```
npm i -D eslint @joshuaavalon/eslint-config-react
```

```js
import globals from "globals";
import typescript from "typescript-eslint";
import reactConfig from "@joshuaavalon/eslint-config-react";

{
  ...reactRules,
  ignores: ["node_modules", "dist"],
  files: ["**/*.ts", "**/*.tsx"],
  settings: { react: { version: "detect" } },
  languageOptions: {
    parser: typescript.parser,
    parserOptions: {
      projectService: true,
      tsconfigDirName: import.meta.dirname,
      ecmaFeatures: { jsx: true }
    },
    globals: {
      ...globals.node,
      ...globals.browser,
      ...globals.nodeBuiltin
    }
  }
}
```
npm package: @joshuaavalon/eslint-config-typescript
Description: Shareable ESLint Typescript config.
Author: Joshua Avalon
Latest version: 11.0.0

# @joshuaavalon/eslint-config-typescript

This is the opinionated ESLint configuration repository that used by myself.
Not support is guaranteed. Use as your own risk.

This configuration include both lint and format rules which may cause conflicts with other formatter like Prettier.

> For <10.0.0, please check https://github.com/joshuaavalon/eslint-config.

## Getting Started

```
npm i -D eslint @joshuaavalon/eslint-config-typescript
```

```js
import globals from "globals";
import typescript from "typescript-eslint";
import jsConfig from "@joshuaavalon/eslint-config-javascript";
import tsConfig from "@joshuaavalon/eslint-config-typescript";

[
  {
    ...tsConfig,
    ignores: ["node_modules", "dist"],
    files: ["**/*.ts"],
    languageOptions: {
      parser: typescript.parser,
      parserOptions: {
        projectService: true,
        tsconfigDirName: import.meta.dirname
      },
      globals: {
        ...globals.node,
        ...globals.browser,
        ...globals.nodeBuiltin
      }
    }
  }
];
```
npm package: @joshuaavalon/fastify-altair
Description: Altair plugin for Fastify.
Author: Joshua Avalon
Latest version: 1.0.0

# fastify-altair

[![License][license_badge]][license] [![Pipelines][pipelines_badge]][pipelines] [![NPM][npm_badge]][npm] [![semantic-release][semantic_release_badge]][semantic_release]

Altair plugin for [Fastify].

[fastify]: https://github.com/fastify/fastify
[license]: ./LICENSE
[license_badge]: https://img.shields.io/badge/license-Apache--2.0-green.svg
[pipelines]: https://github.com/joshuaavalon/fastify-altair/actions/workflows/main.yml
[pipelines_badge]: https://github.com/joshuaavalon/fastify-altair/actions/workflows/main.yml/badge.svg
[npm]: https://www.npmjs.com/package/fastify-altair
[npm_badge]: https://img.shields.io/npm/v/fastify-altair/latest.svg
[semantic_release]: https://github.com/semantic-release/semantic-release
[semantic_release_badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
npm package: @joshuaavalon/fastify-cqrs
Description: CQRS plugin for Fastify.
Author: Joshua Avalon
Latest version: 1.0.2

# fastify-cqrs

[![License][license_badge]][license] [![Pipelines][pipelines_badge]][pipelines] [![NPM][npm_badge]][npm] [![semantic-release][semantic_release_badge]][semantic_release]

CQRS plugin for [Fastify].

## Usage

```ts
import fastifyCqrs from "fastify-cqrs";
// Register plugin
fastify.register(fastifyCqrs);
```

[fastify]: https://github.com/fastify/fastify
[license]: ./LICENSE
[license_badge]: https://img.shields.io/badge/license-Apache--2.0-green.svg
[pipelines]: https://github.com/joshuaavalon/fastify-cqrs/actions/workflows/main.yml
[pipelines_badge]: https://github.com/joshuaavalon/fastify-cqrs/actions/workflows/main.yml/badge.svg
[npm]: https://www.npmjs.com/package/fastify-cqrs
[npm_badge]: https://img.shields.io/npm/v/fastify-cqrs/latest.svg
[semantic_release]: https://github.com/semantic-release/semantic-release
[semantic_release_badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
npm package: @joshuaavalon/fastify-plugin-auth
Description: Auth plugin for fastify
Author: Joshua Avalon
Latest version: 2.0.2

# @joshuaavalon/fastify-plugin-auth

## Getting Started

> This is a ESM only module. You must be using ESM in order to use this.

```sh
npm install @joshuaavalon/fastify-plugin-auth
```

### Configuration

```ts
import type { PureAbility } from "@casl/ability";

declare module "@joshuaavalon/fastify-plugin-auth" {
  interface AuthContextConfig {
    // Define the ability of you application
    readonly ability: PureAbility<["action", "subject"]>;
  }
  interface AuthUser {
    // Customize your user object
    id: string;
  }
  interface CreateUserTokenOptions {
    // Extra options for you when creating user token
  }
}
```

### Initialize Plugin

```ts
import plugin from "@joshuaavalon/fastify-plugin-auth";

await app.register(plugin, {
  authContext: {
    async createAbility() {
      const createAppAbility = createMongoAbility as CreateAbility<AppAbility>;
      const builder = new AbilityBuilder(createAppAbility);
      return builder.build();
    },
    // Need to store and generate a unique value
    async createUserToken() {
      return "userToken";
    },
    defaultCreateUserTokenOptions: {
      // Custom options for creating user token
    },
    // Find user by user token
    async findUser() {
      return { name: "name" };
    }
  },
  // Must init @fastify/cookie
  // Default to false which you need to initialize manually
  initCookieOpts: true,
  // Must init @fastify/secure-session with refreshSession, session
  // Default to false which you need to initialize manually
  initSessionOpts: {
    refreshSession: { salt, secret },
    session: { salt, secret }
  }
});
```

### Usage

```ts
import {
  hashPassword,
  verifyPassword
} from "@joshuaavalon/fastify-plugin-auth/func";
```
npm package: @joshuaavalon/fastify-plugin-file-routes
Description: Fastify plugin for file based routing
Author: Joshua Avalon
Latest version: 1.1.3

# @joshuaavalon/fastify-plugin-file-routes

## Getting Started

> This is a ESM only module. You must be using ESM in order to use this.

```sh
npm install @joshuaavalon/fastify-plugin-file-routes
```

```ts
import { URL, fileURLToPath } from "node:url";
import fastify from "fastify";
import fileRoutesPlugin from "@joshuaavalon/fastify-plugin-file-routes";

const routesDir = fileURLToPath(new URL("./routes", import.meta.url));

const app = await fastify();
await app.register(fileRoutesPlugin, { baseDir: routesDir });
```

```ts
import { routes } from "@joshuaavalon/fastify-plugin-file-routes";

export default routes({
  get: {
    opts: {},
    async handler(req, res) {
      const { params } = req;
      res.send(params);
    }
  }
});
```

```
routes/
├─ index.ts
├─ path1.ts
├─ foo/
│  └─ [id].ts
└─ bar/
   └─ [...].ts
```

## Usage

For file, it will resolve to file name, except `index` which resolve to current level. For example,

- `a/b/index.ts` => `/a/b`
- `a/b/c.ts` => `/a/b/c`

For path parameters, it uses `[<name>]`.

- `a/[id]/c.ts` => `/a/:id/c`
- `a/b/[id].ts` => `/a/b/:id`

For wildcard path parameters, it uses `[<name>]`.

- `a/[...]/c.ts` => `/a/*/c`
- `a/b/[...].ts` => `/a/b/*`

Please refer to [Fastify](https://fastify.dev/docs/latest/Reference/Routes/#url-building) for more details on path parameters.

## Options

- `baseDir`: Base directory to search for route files
- `ignore`: Regular expression to ignore directories and files. Default to `/^\.|^_|\.test\.|\.spec\.|__tests__/gu`
- `match`: Regular expression to match route files. Default to `/\.js/gu`
- `prefix`: Prefix for all routes. Default to `/`
npm package: @joshuaavalon/fastify-plugin-network
Description: Network plugin for fastify
Author: Joshua Avalon
Latest version: 1.0.0

# @joshuaavalon/fastify-plugin-network

## Getting Started

> This is a ESM only module. You must be using ESM in order to use this.

```sh
npm install @joshuaavalon/fastify-plugin-network
```
npm package: @joshuaavalon/fastify-plugin-prisma
Description: Prisma plugin for fastify
Author: Joshua Avalon
Latest version: 2.0.0

# @joshuaavalon/fastify-plugin-prisma

## Getting Started

```sh
npm i @joshuaavalon/fastify-plugin-prisma
```

## Usage

```typescript
import prismaPlugin from "@joshuaavalon/fastify-plugin-prisma";

// See PrismaPluginOptions
const opts = {};
await fastify.register(prismaPlugin, opts);

const user = await fastify.db.user.findFirst();
```

## Options
npm package: @joshuaavalon/fastify-plugin-storage
Description: Storage plugin for fastify
Author: Joshua Avalon
Latest version: 3.0.0

# @joshuaavalon/fastify-plugin-storage

## Getting Started

```sh
npm i @joshuaavalon/fastify-plugin-storage
```

## Usage

```typescript
import storagePlugin from "@joshuaavalon/fastify-plugin-storage";
import type { Storage } from "@joshuaavalon/fastify-plugin-storage";

declare module "@joshuaavalon/fastify-plugin-storage" {
  interface FastifyStorage {
    name: Storage;
  }
}

await fastify.register(storagePlugin, {
  storage: {
    name: {
      type: "S3"
    }
  }
});

await fastify.storage.write({ body: buffer, contentType: mime });
```
npm package: @joshuaavalon/fastify-plugin-swagger
Description: Swagger plugin for fastify
Author: Joshua Avalon
Latest version: 1.0.0

# @joshuaavalon/fastify-plugin-swagger

It uses [@fastify/swagger] for generating OpenAPI 3.0 JSON and [@scalar/fastify-api-reference] for the web interface.

It is a wrapper for both plugins and allows to configure common values between plugins.

## Getting Started

> This is a ESM only module. You must be using ESM in order to use this.

```sh
npm install @joshuaavalon/fastify-plugin-swagger
```

The payload of the request and response (JSON) are considered as encoded type in terms of Typebox transform.
This means the based types should be JSON type instead internal type.

```ts
import fastify from "fastify";
import swaggerPlugin from "@joshuaavalon/fastify-plugin-swagger";

const app = await fastify();
await app.register(swaggerPlugin, {
  description: "",
  title: "API",
  version: "1.0.0",
  routePrefix: "/api"
});
```

## Options

### title

Title of OpenAPI 3.0.

### version

Version of OpenAPI 3.0.

### description

Description of OpenAPI 3.0.

### logBindings

**Optional**

`logBindings` set the binding for all the log in this plugin.

Default to `{ plugin: "@joshuaavalon/fastify-plugin-swagger" }`.
Set to `false` to disable it.

### defaultOpenAllTags

**Optional**

Open all tags in scalar instead of relevant tag.
Default to `true`.

### routePrefix

**Optional**

Prefix path for Swagger.

[@fastify/swagger]: https://github.com/fastify/fastify-swagger
[@scalar/fastify-api-reference]: https://github.com/scalar/scalar/tree/main/packages/fastify-api-reference
npm package: @joshuaavalon/gatsby-remark-prismjs
Description: Adds syntax highlighting to code blocks at build time using PrismJS
Author: Joshua Avalon
Latest version: 3.3.1

# @joshuaavalon/gatsby-remark-prismjs

Fork of [gatsby-remark-prismjs][gatsby]. Rewritten in TypeScript and fixed some bugs.

Use as your own risk.

[gatsby]: https://www.npmjs.com/package/gatsby-remark-prismjs