open-index/open-npm huggingface dataset:
npm package: @kikiutils/classes
Description: A utility library providing various classes for advanced operations and manipulations.
Author: kiki-kanri
Latest version: 7.0.0
Deprecated: This package has been merged into @kikiutils/shared. Please use that package instead.

# @kikiutils/classes

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]

A utility library providing various classes for advanced operations and manipulations.

- [✨ Release Notes](./CHANGELOG.md)

## Features

- 📁 Path Class: Convenient manipulation and querying of file system paths with immutable methods.
- 🔢 PrecisionNumber Class: Accurate arithmetic operations with configurable decimal places and rounding using `Decimal.js`.

## Requirements

- **Node.js** `>= 22.0.0`

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add @kikiutils/classes
```

You can also use `yarn`, `npm`, or `bun`.

> [!NOTE]
> This package is modular. It does not install all dependencies by default.
>
> If a class depends on a third-party package (e.g. `decimal.js`), you must install it manually.

## Usage
Detailed descriptions and examples can be found in the annotations within each class.

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/classes
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/classes/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/classes
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/classes.svg?colorA=18181b&colorB=28cf8d&style=flat

[codecov-href]: https://codecov.io/gh/kikiutils/node-classes
[codecov-src]: https://codecov.io/gh/kikiutils/node-classes/graph/badge.svg?token=

[license-href]: https://github.com/kikiutils/node-classes/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/node-classes?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kikiutils/eslint-config
Description: Using antfu/eslint-config as a base for eslint-config, slightly modified the settings and added additional plugins, mainly for my own use.
Author: kiki-kanri
Latest version: 7.0.3

# @kikiutils/eslint-config

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]

Description

- [✨ Release Notes](./CHANGELOG.md)

## Features

## Requirements

- **Node.js** `>=22.12.0`

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add -D @kikiutils/eslint-config
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/eslint-config
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/eslint-config/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/eslint-config
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/eslint-config.svg?colorA=18181b&colorB=28cf8d&style=flat

[license-href]: https://github.com/kikiutils/eslint-config/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/eslint-config?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kikiutils/modem-manager
Description: Modem manager utils.
Author: kiki-kanri
Latest version: 1.0.6
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @kikiutils/modem-manager

Modem manager (mmcli) for nodejs.

Only supported linux ubuntu 22.04 or later version.

Requirements packages：libqmi-utils modemmanager.

**Detailed documentation will be added in future releases.**

**There may be major changes in the future.**

**This package must be executed with root privileges, and it is dedicated to my own project and does not contain all functions and types declarations, please use with caution.**
npm package: @kikiutils/mongoose
Description: A Mongoose plugin for enhanced JSON normalization and common schema creation, with built-in support for pagination and automatic Decimal128 conversion.
Author: kiki-kanri
Latest version: 7.0.1

<!-- TODO: Update -->

# @kikiutils/mongoose

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]

A Mongoose plugin for enhanced JSON normalization and common schema creation, with built-in support for pagination and automatic Decimal128 conversion.

- [✨ Release Notes](./CHANGELOG.md)

## Features

- ✨ Flexible Connections: Supports both default and custom connections, automatically creating connections when none are provided
- 🔌 Plugin Integration: Automatically integrates `mongoose-aggregate-paginate-v2`, `mongoose-paginate-v2`, and custom normalization for cleaner JSON outputs
- 🛠 Predefined & Customizable Schemas: Provides common schemas (boolean, date, decimal128, number, objectId, string) with the flexibility to customize attributes such as `private`, `required`, `unique`, `default`, and more
- 🧮 Decimal Precision: Supports `Decimal128` fields with options for automatic rounding and fixed decimal precision
- 🔄 Optimized JSON Output: Adds an `id` field, removes `_id` and `__v`, hides private fields, and converts `Decimal128` fields to strings in JSON responses
- 🔄 Reference Management: Enables easy conversion of ObjectId references to fully populated documents with field selection and population options
- 🔧 Utility Functions: Includes helper functions for converting and normalizing documents, handling ObjectId transformations, and processing schema fields

## Requirements

- **Mongoose** `>=9`
- **Node.js** `>=22.12.0`

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add @kikiutils/mongoose mongoose
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

<!-- TODO: Full doc. -->
To be completed.

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/mongoose
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/mongoose/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/mongoose
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/mongoose.svg?colorA=18181b&colorB=28cf8d&style=flat

[codecov-href]: https://codecov.io/gh/kikiutils/node-mongoose
[codecov-src]: https://codecov.io/gh/kikiutils/node-mongoose/graph/badge.svg?token=DM89MM6FPK

[license-href]: https://github.com/kikiutils/node-mongoose/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/node-mongoose?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kikiutils/nuxt
Description: Nuxt module.
Author: kiki-kanri
Latest version: 10.3.4

# @kikiutils/nuxt

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

Description

- [✨ Release Notes](./CHANGELOG.md)

## Features

## Requirements

- **Node.js** `>=22.12.0`
- **Nuxt** `>=3.13.0`

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add @kikiutils/nuxt @kikiutils/shared @nuxtjs/robots @vueuse/nuxt
pnpm add -D @unocss/nuxt unplugin-fonts
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/nuxt
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/nuxt/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/nuxt
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/nuxt.svg?colorA=18181b&colorB=28cf8d&style=flat

[codecov-href]: https://codecov.io/gh/kikiutils/nuxt
[codecov-src]: https://codecov.io/gh/kikiutils/nuxt/graph/badge.svg?token=4FFWT4TFFH

[license-href]: https://github.com/kikiutils/nuxt/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/nuxt?colorA=18181b&colorB=28cf8d&style=flat

[nuxt-href]: https://nuxt.com
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181b?logo=nuxt.js
npm package: @kikiutils/puppeteer
Description: Base or utils classes and functions for puppeteer.
Author: kiki-kanri
Latest version: 1.0.8
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @kikiutils/puppeteer

For node puppeteer base or utils classes and functions.

**Detailed documentation will be added in future releases.**

**There may be major changes in the future.**
npm package: @kikiutils/qmicli
Description: Qmicli utils.
Author: kiki-kanri
Latest version: 1.0.7
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @kikiutils/qmicli

Qmicli for nodejs.

Only supported linux ubuntu 22.04 or later version.

Requirements packages：libqmi-utils modemmanager.

**Detailed documentation will be added in future releases.**

**There may be major changes in the future.**

**This package must be executed with root privileges, and it is dedicated to my own project and does not contain all functions and types declarations, please use with caution.**
npm package: @kikiutils/stylelint-config
Description: [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![codecov][codecov-src]][codecov-href] [![License][license-src]][license-href]
Author: kiki-kanri
Latest version: 0.4.1

# @kikiutils/stylelint-config

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]

Description

- [✨ Release Notes](./CHANGELOG.md)

## Features

## Requirements

- **Node.js** `>=22.12.0`

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add -D @kikiutils/stylelint-config
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/stylelint-config
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/stylelint-config/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/stylelint-config
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/stylelint-config.svg?colorA=18181b&colorB=28cf8d&style=flat

[codecov-href]: https://codecov.io/gh/kikiutils/stylelint-config
[codecov-src]: https://codecov.io/gh/kikiutils/stylelint-config/graph/badge.svg?token=

[license-href]: https://github.com/kikiutils/stylelint-config/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/stylelint-config?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kikiutils/tsconfigs
Description: Preconfigured TypeScript config files for stricter type checking and multi-environment support.
Author: kiki-kanri
Latest version: 6.0.0

# @kikiutils/tsconfigs

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]

Preconfigured TypeScript config files for stricter type checking and multi-environment support.

- [✨ Release Notes](./CHANGELOG.md)

## Features

- ⚙️ Preconfigured `tsconfig` with `strict` mode, stricter type checking (`isolatedModules`, `noUncheckedSideEffectImports`), and clean ESM support
- 🧬 Easy inheritance via the `extends` field in `tsconfig`
- 🔀 Multiple `tsconfig` variants to support different `module` and `target` settings
- 🧪 Shared Jest testing config for consistent test setup
- 🍞 Includes official Bun settings for seamless integration

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add -D @kikiutils/tsconfigs
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

The base configuration is [`tsconfig.base.json`](./tsconfig.base.json).
You can extend it directly or pick one that matches your desired `module` and `target`.

Here's an example of a typical `tsconfig.json` setup:

```json
{
  "extends": "@kikiutils/tsconfigs/esnext/es2022.json",
  "compilerOptions": {
    "declaration": true,
    "declarationDir": "./dist",
    "declarationMap": true,
    "emitDeclarationOnly": true
  },
  "include": ["./src"]
}
```

The extends path is structured as:

```jsonl
@kikiutils/tsconfigs/<module>/<target>.json
```

For example, to use CommonJS as the module and ES2021 as the target, set:

```jsonl
"extends": "@kikiutils/tsconfigs/commonjs/es2021.json"
```

For unit testing with Jest, you can extend the shared Jest config:

```jsonl
"extends": "@kikiutils/tsconfigs/jest.json"
```

> [!NOTE]
> All paths and file names are lowercase.
>
> 🍞 If you're using the Bun runtime, simply use:
>
> ```jsonl
> "extends": "@kikiutils/tsconfigs/bun.json"
> ```

### Available modules

- AMD
- CommonJS
- ES6
- ES2015
- ES2020
- ES2022
- ESNext
- Node16
- Node18
- NodeNext
- None
- Preserve
- System
- UMD

### Available targets

- ES3
- ES5
- ES6
- ES2015
- ES2016
- ES2017
- ES2018
- ES2019
- ES2020
- ES2021
- ES2022
- ES2023
- ES2024
- ESNext

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/tsconfigs
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/tsconfigs/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/tsconfigs
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/tsconfigs.svg?colorA=18181b&colorB=28cf8d&style=flat

[license-href]: https://github.com/kikiutils/node-tsconfigs/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/node-tsconfigs?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kikiutils/types
Description: Lightweight utility types package with global declarations, Vue support, and no import required.
Author: kiki-kanri
Latest version: 8.0.0
Deprecated: This package has been merged into @kikiutils/shared. Please use that package instead.

# @kikiutils/types

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]

Lightweight utility types package with global declarations, Vue support, and no import required.

- [✨ Release Notes](./CHANGELOG.md)

TODO: Update README

## Features

- 🛠 Provides commonly used or simplified utility types
- 🌍 Declares types globally via `declare global`, no imports needed
- 📦 Mounts select `type-fest` types to the global scope
- 🧩 Includes Vue component instance-related types

## Installation

Using [pnpm](https://pnpm.io):

```bash
pnpm add -D @kikiutils/types
```

You can also use `yarn`, `npm`, or `bun`.

## Usage

Load the types in any `.ts` or `.d.ts` file — only once is needed:

```typescript
import type {} from '@kikiutils/types';
import type {} from '@kikiutils/types/vue';
// Or
export type {} from '@kikiutils/types';
export type {} from '@kikiutils/types/vue';
```

You can load only the types you need.

> [!IMPORTANT]
> Make sure this file is located within a path included in the `include` field of your `tsconfig.json`.

## Types

### [index](./src/index.ts)

The index file includes both utility types and `type-fest` types.

- `AnyRecord`
- `BinaryInput`
- `Dict`
- `MaybePartial`
- `MaybeReadonly`
- `Nullable`
- `PartialDict`
- `PartialRecord`
- `ReadonlyDict`
- `ReadonlyPartialRecord`
- `ReadonlyRecord`

### [type-fest](./src/type-fest.ts)

- `Arrayable`
- `Promisable`
- `ReadonlyDeep`
- `SetOptional`
- `SetRequired`

### [utils](./src/utils)

- `FilteredKeyPath`

### [vue](./src/vue.ts)

- `Booleanish`
- `ComponentRef`
- `Numberish`
- `ShallowUnwrapRef`
- `UnwrapNestedRefs`
- `UnwrapRef`

## License

[MIT License](./LICENSE)

<!-- Badges -->
[npm-version-href]: https://npmjs.com/package/@kikiutils/types
[npm-version-src]: https://img.shields.io/npm/v/@kikiutils/types/latest.svg?colorA=18181b&colorB=28cf8d&style=flat

[npm-downloads-href]: https://npmjs.com/package/@kikiutils/types
[npm-downloads-src]: https://img.shields.io/npm/dm/@kikiutils/types.svg?colorA=18181b&colorB=28cf8d&style=flat

[license-href]: https://github.com/kikiutils/node-types/blob/main/LICENSE
[license-src]: https://img.shields.io/github/license/kikiutils/node-types?colorA=18181b&colorB=28cf8d&style=flat
npm package: @kiko-yd/vue-show-more
Description: A lightweight Vue 3 component for expanding/collapsing long text content
Author: YoungDan
Latest version: 0.0.1-beta.2

# Vue Show More

一个轻量级的 Vue 3 组件，用于处理多行文本的展开/收起功能。

## 特性

- 🎯 支持自定义展开行数
- 🎨 支持通过插槽自定义展开/收起按钮
- 📱 响应式设计，支持移动端
- ⚡ 零依赖，轻量级
- 💪 使用 Vue 3 + TypeScript 开发，提供完整类型支持
- 🎈 灵活的按钮位置：支持内联和底部两种样式

## 安装

```bash
npm install @kiko-yd/vue-show-more
# 或
yarn add @kiko-yd/vue-show-more
```

## 使用方法

### 基础用法

```vue
<template>
  <ShowMore
    :max-lines="3"
    expand-text="展开"
    collapse-text="收起"
    @expand="onExpand"
  >
    这是一段很长的文本...
  </ShowMore>
</template>

<script setup lang="ts">
import { ShowMore } from "vue-show-more";
</script>
```

### 内联按钮样式

```vue
<template>
  <ShowMore
    :max-lines="3"
    action-position="inline"
    expand-text="展开"
    collapse-text="收起"
    mask-background="#f5f5f5"
  >
    <p style="font-size: 18px">这是一段很长的文本...</p>
  </ShowMore>
</template>
```

### 自定义展开/收起按钮

```vue
<template>
  <ShowMore :max-lines="3">
    <div style="font-size: 16px">这是一段很长的文本...</div>
    <template #action="{ isExpanded }">
      <button class="custom-button">
        {{ isExpanded ? "收起" : "查看更多" }}
        <icon-arrow :direction="isExpanded ? 'up' : 'down'" />
      </button>
    </template>
  </ShowMore>
</template>
```

## Props

| 属性              | 类型                 | 默认值   | 描述                                                                              |
| ----------------- | -------------------- | -------- | --------------------------------------------------------------------------------- |
| maxLines          | number               | 3        | 收起状态下显示的最大行数                                                          |
| expandText        | string               | "展开"   | 展开按钮的文本                                                                    |
| collapseText      | string               | "收起"   | 收起按钮的文本                                                                    |
| class             | string               | -        | 自定义样式类名                                                                    |
| expandButtonClass | string               | -        | 展开按钮的自定义样式类名                                                          |
| actionPosition    | 'inline' \| 'bottom' | 'bottom' | 展开/收起按钮的位置。'inline' 表示按钮跟随在文本末尾，'bottom' 表示按钮在新行显示 |
| maskBackground    | string               | 'white'  | 内联模式下的背景色，用于遮罩层和按钮背景，应与容器背景色保持一致                  |

## 插槽

### default

默认插槽，用于传入需要展开/收起的内容。默认按钮会自动继承该内容的字体样式。

### action

自定义展开/收起按钮的内容和样式

#### 作用域参数

| 参数名       | 类型    | 说明         |
| ------------ | ------- | ------------ |
| isExpanded   | boolean | 当前是否展开 |
| expandText   | string  | 展开按钮文本 |
| collapseText | string  | 收起按钮文本 |

## 事件

| 事件名 | 参数                | 描述                    |
| ------ | ------------------- | ----------------------- |
| expand | isExpanded: boolean | 展开/收起状态改变时触发 |

## License

MIT
npm package: @kikobeats/async-listen
Description: Promisify server.listen for your HTTP/HTTPS/TCP server.
Author: microlink.io
Latest version: 0.0.0

# async-listen

![Last version](https://img.shields.io/github/tag/microlinkhq/async-listen.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/microlinkhq/async-listen.svg?style=flat-square)](https://coveralls.io/github/microlinkhq/async-listen)
[![NPM Status](https://img.shields.io/npm/dm/async-listen.svg?style=flat-square)](https://www.npmjs.org/package/async-listen)

The [server.listen](https://nodejs.org/api/net.html#serverlisten) in Node.js is based on an event emitter, meaning the event should be waited before interacting with the server.

**async-listen** is the missing interface for consuming `server.listen` as promise.

## Install

```bash
$ npm install async-listen --save
```

## Usage

```js
const listen = require('async-listen')
const { createServer } = require('http')

const server = createServer((req, res) => {
  res.end('hello world!')
})

const url = await listen(server)

console.log(`Listening at ${url.toString()}`)
```

After passing `server` as first argument, the rest of parameters are the same than `server.listen`:

```js
/* IPv6 with random port (default) */
await listen(server)

/* IPv6 with port */
await listen(server, 3001)

/* IPv4 with random port */
await listen(server, { host: '127.0.0.1', port: 0 })
```

## License

**async-listen** © [microlink.io](https://microlink.io), released under the [MIT](https://github.com/microlinkhq/async-listen/blob/master/LICENSE.md) License.<br>
Authored and maintained by [microlink.io](https://microlink.io) with help from [contributors](https://github.com/microlinkhq/async-listen/contributors).

> [microlink.io](https://microlink.io) · GitHub [microlink.io](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq)
npm package: @kikobeats/cloudflare-workers-kv
Description: CloudFlare Workers KV storage adapter for Keyv
Author: Kiko Beats
Latest version: 1.0.11

# @kikobeats/cloudflare-workers-kv

![Last version](https://img.shields.io/github/tag/Kikobeats/cloudflare-workers-kv.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/cloudflare-workers-kv.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/cloudflare-workers-kv)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/cloudflare-workers-kv.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/cloudflare-workers-kv)

> Node.js library to interact with [CloudFlare Workers KV](https://developers.cloudflare.com/workers/reference/storage).

[CloudFlare Workers KV](https://developers.cloudflare.com/workers/reference/storage) is [faster](https://serverless-benchmark.com) &lt;key, value&gt; storage that runs on top of [CloudFlare Network](https://www.cloudflare.com/network) to offer a geo-distributed service almost **free** or reasonable cheaper.

Use it in combination with [CloudFlare Workers](https://workers.cloudflare.com) or [AWS Lambda](https://aws.amazon.com/lambda) to have a truly [serverless database access](https://medium.com/@tjholowaychuk/global-serverless-apps-with-aws-lambda-api-gateway-4642ef1f221d), where the value will be serve from the nearest edge node, being the lowest response latency possible.

## Install

```bash
$ npm install @kikobeats/cloudflare-workers-kv --save
```

## Usage

The library is a convenient way to interact with CloudFlare Workers KV via usinng [CloudFlare Workers KV API](https://api.cloudflare.com/#workers-kv-namespace-properties).

```js
const cloudFlareWorkersKV = require('@kikobeats/cloudflare-workers-kv')
const ms = require('ms')

const store = cloudFlareWorkersKV({
  accountId: '<Cloudflare-Account-Id>',
  key: '<Cloudflare-API-Key>',
  namespaceId: '<Cloudflare-Workers-KV-Namespace-Id>'
})

async function examples () {
  // get a value
  await store.get('foo')

  // set a value forever
  await store.set('foo', 'bar')

  // set a value associating with a time-to-live associated
  await store.set('foo', 'bar', ms('5m'))

  // delete a value
  await store.delete('foo')
}
```

## Authentication

At CloudFlare dashboard, enter to `Your Profile` > `API Token` > `Create Token`.

Then use `CloudFlare Workers` template and ensure at least the permission `Workers KV Storage` is present.

The API token provided should be provided as `key`.

## License

**@kikobeats/cloudflare-workers-kv** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/cloudflare-workers-kv/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/cloudflare-workers-kv/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)
npm package: @kikobeats/content-type
Description: A fast way to get the content type from the input string.
Author: Kiko Beats
Latest version: 1.0.4

# @kikobeats/content-type

![Last version](https://img.shields.io/github/tag/kikobeats/@kikobeats/content-type.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/kikobeats/@kikobeats/content-type.svg?style=flat-square)](https://coveralls.io/github/kikobeats/@kikobeats/content-type)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/content-type.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/content-type)

> A fast way to get the content type from the input string.

This is a lightweight version of [jshttp/content-type](https://github.com/jshttp/content-type) for scenarios where you only want to get the content type value without parameters.

It's 90% faster; see [benchmark](benchmark/README.md) to know more.

## Install

```bash
$ npm install @kikobeats/content-type --save
```

## Usage

Let's say the input string is `'text/html; charset=utf-8;'`.

Use the library to return the content type stripping parameters:

```js
const contentType = require('@kikobeats/content-type')
contentType(res.headers['content-type'])
// => text/html
```

## API

### getContentType(input, [options])

#### input

*Required*<br>
Type: `string`

The input for getting the content type.

#### options

##### strict

Type: `boolean`<br>
Default: `false`

When strict is enabled, it will return null when the input doesn not follow conten-type header spec.

## License

**@kikobeats/content-type** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/kikobeats/@kikobeats/content-type/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/kikobeats/@kikobeats/content-type/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/kikobeats) · Twitter [@kikobeats](https://twitter.com/kikobeats)
npm package: @kikobeats/conventional-changelog
Description: I'm a lazy
Author: Kiko Beats
Latest version: 0.0.0

# conventional-changelog

Efortless `CHANGELOG.md` for [conventional commits](https://conventional-commits.vercel.app/).

## Install

```bash
npx @kikobeats/conventional-changelog
```

## Usage

Prepend the latest release to your changelog:

```bash
conventional-changelog -i CHANGELOG.md -o CHANGELOG.md -r 1
```

Regenerate the entire changelog (overwrites outfile):

```bash
conventional-changelog -i CHANGELOG.md -o CHANGELOG.md -r 0
```

Write the latest release to a different file:

```bash
conventional-changelog -i CHANGELOG.md -o /tmp/notes.md -r 1
```

## Options

- `-i, --infile`          Read from this file (default: `CHANGELOG.md`)
- `-o, --outfile`         Write to this file (default: infile)
- `-r, --release-count`   Number of releases to generate (default: `1`; `0` regenerates everything)

## License

**conventional-changelog** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/kikobeats/conventional-changelog/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/kikobeats/conventional-changelog/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/kikobeats) · Twitter [@kikobeats](https://twitter.com/kikobeats)
npm package: @kikobeats/generator-react
Description: Create a React library project scaffold
Author: Kiko Beats
Latest version: 1.0.7

# generator-react

![Last version](https://img.shields.io/github/tag/kikobeats/generator-react.svg?style=flat-square)
[![Dependency status](http://img.shields.io/david/Kikobeats/generator-react.svg?style=flat-square)](https://david-dm.org/Kikobeats/generator-react)
[![Dev Dependencies Status](http://img.shields.io/david/dev/Kikobeats/generator-react.svg?style=flat-square)](https://david-dm.org/Kikobeats/generator-react#info=devDependencies)
[![NPM Status](http://img.shields.io/npm/dm/generator-react.svg?style=flat-square)](https://www.npmjs.org/package/generator-react)
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)

> Create a React library project scaffold.

## Features

### on development

- Write moden JavaScript code transpiled by [Babel](https://babeljs.io).
- Lint and pretty your code in each commit using [Standard](https://standardjs.com) & [Prettier](https://prettier.io).

### on testing

> **Note**: Remember connect your repository with [Travis](https://travis-ci.org) & [Netlify](https://www.netlify.com).

- Check your code is correctly linted.
- Check your dependencies is up to date with [ncu](https://www.npmjs.com/package/npm-check-updates).
- Create a deploy preview using [Netlify](https://www.netlify.com).

### on production

- Compiles into ES2015+ code using [babel-preset-env](https://github.com/babel/babel-preset-env).
- Create multibundle (ES, CJS, UMD) using [microbundle](https://github.com/developit/microbundle).

The best part is... it just works, you don't need to think about that, just in your code.

## Install

First, install Yeoman:

```bash
$ npm install -g yo
```

Later, install this generator:

```bash
$ npm install -g @kikobeats/generator-react
```

## Usage

```bash
$ yo react
```

## License

MIT © [Kiko Beats](http://kikobeats.com)
npm package: @kikobeats/jsonsort
Description: Sort an object or a collection of objects based on a criteria.
Author: Kiko Beats
Latest version: 1.3.25

# @kikobeats/jsonsort

![Last version](https://img.shields.io/github/tag/Kikobeats/jsonsort.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/Kikobeats/jsonsort/master.svg?style=flat-square)](https://travis-ci.org/Kikobeats/jsonsort)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/jsonsort.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/jsonsort)

> Sort an object or a collection of objects based on a criteria.

## Install

```bash
$ npm install @kikobeats/jsonsort --global
```

## CLI

```bash
$ jsonsort <file>[flags]

Flags
  --criteria  Specify the criteria to sort. It can be a key name or fat arrow function.
  --quiet     Avoid print output
  --save      Write the output back. If a path is specified, it will be used over the original

Examples
  $ jsonsort file.json # Just output a sorted json
  $ jsonsort file.json --criteria name # Sort an array of objects based on alphabetical `name` value.
  $ jsonsort file.json --criteria 'x => x.featured' # Passing a function as criteria.
  $ jsonsort file.json --criteria name --save # Sort and save the result.
  $ jsonsort file.json --criteria name --save # Sort, save but dont print result.

```

It's easy to complement with others UNIX commands, like `jq`:

```bash
jq .redirects now.json | jsonsort --criteria source
```

## License

**jsonsort** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/jsonsort/blob/master/LICENSE.md) License.<br>
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/jsonsort/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)
npm package: @kikobeats/map-keys-deep
Description: Recursive lodash.mapKeys
Author: Kiko Beats
Latest version: 1.0.5

# @kikobeats/map-keys-deep

![Last version](https://img.shields.io/github/tag/Kikobeats/map-keys-deep.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/Kikobeats/map-keys-deep/master.svg?style=flat-square)](https://travis-ci.com/Kikobeats/map-keys-deep)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/map-keys-deep.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/map-keys-deep)

> Recursive lodash.mapKeys

## Install

```bash
$ npm install lodash @kikobeats/map-keys-deep --save
```

## Usage

```js
const mapKeysDeep = require('@kikobeats/map-keys-deep')

mapKeysDeep({ Hello: { World: true } }, (value, key) => key.toLowerCase())
// => { hello: { world: true } }
```
## License

**map-keys-deep** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/map-keys-deep/blob/master/LICENSE.md) License.<br>
Authored and maintained by Kiko Beats with help from [contributors](https://github.com/Kikobeats/map-keys-deep/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)
npm package: @kikobeats/scritch
Description: A small CLI to help you write sharable scripts for your team
Author: Jamie Kyle
Latest version: 1.7.5

# Scritch

> Easily create a tiny CLI to help you write sharable scripts for your team

- Write scripts in any scripting language (JavaScript, Bash, Python, etc)
- Share your scripts as a CLI via npm
- Depend on other CLIs/libraries distributed via npm
- Injects useful environment variables into your script
- Strips ANSI escape codes in CI

## Install

```sh
npm install scritch
```

## Guide

Create a new npm package:

```sh
git init company-cli && cd company-cli
npm init
```

Create a `cli.js` file and call Scritch inside:

```sh
#!/usr/bin/env node
require('scritch')(__dirname)
```

Then make it executable:

```sh
chmod +x ./cli.js
```

Add `cli.js` as your `package.json#bin`:

```json
{
  "bin": "./cli.js"
}
```

Next create a `scripts` folder:

```sh
mkdir scripts
```

Then start adding scripts in your favorite scripting language:

```sh
touch scripts/build.sh
```

```sh
#!/bin/sh
set -e

start=$(date +%s)
echo "Building files..."

for i in $(seq 1 10); do
  sleep 0.1
  echo "- File $i built."
done

end=$(date +%s)
total=$((end-start))

echo "10 files built in $((total))s."
```

When you're done, make sure all the scripts you write are executable:

```sh
chmod +x ./scripts/*
```

## Usage

### Package Structure

Your package structure should look like this:

```
/company-cli/
  package.json
  cli.js (executable)
  /scripts/
    build.sh (executable)
    lint.js (executable)
    test.py (executable)
```

> **Note:** Scripts inside of `scripts/*` can be written in any scripting
> language.

In order to make the appropriate files executable you can run:

```sh
chmod +x ./cli.js
chmod +x ./scripts/*
```

Your `package.json` file should have the following fields:

```json
{
  "name": "company-cli",
  "version": "1.0.0",
  "description": "Our company's CLI",
  "bin": "cli.js",
  "dependencies": {
    "scritch": "*"
  }
}
```

### API Usage

The simplest usage of scritch is the following `cli.js` file:

```js
#!/usr/bin/env node
require('scritch')(__dirname)
```

But scritch accepts other options:

```js
#!/usr/bin/env node
require('scritch')(__dirname, {
  // An alternate path to where your scripts are located
  scriptsPath: 'build/scripts',

  // Additional help content, great for examples
  help: `
    Examples
      Build all files:
      $ company-cli build

      Lint all files:
      $ company-cli lint

      Run all tests:
      $ company-cli test
  `,
  // Additional environment variables you would like to pass to all scripts
  env: {
    HELPER_ENV_VARIABLE: 'some value'
  }
})
```
npm package: @kikobeats/time-span
Description: simple high resolution timing
Author: Kiko Beats
Latest version: 1.0.12

# time-span

![Last version](https://img.shields.io/github/tag/Kikobeats/time-span.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/time-span.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/time-span)
[![NPM Status](https://img.shields.io/npm/dm/@kikobeats/time-span.svg?style=flat-square)](https://www.npmjs.org/package/@kikobeats/time-span)

> A zero dependencies high resolution timing function.

## Install

```bash
$ npm install @kikobeats/time-span --save
```

## Usage

```js
const { setTimeout } = require('timers/promises')
const timeSpan = require('@kikobeats/time-span')()

const duration = timeSpan()
await setTimeout(5000)

console.log(duration()) // => 5001.870375
```

It also accepts a `format` function:

```js
const timeSpan = require('@kikobeats/time-span')({
  format: n => `${Math.round(n)}ms`
})

const duration = timeSpan()
await setTimeout(5000)
console.log(duration()) // => 5000ms
```

## License

**time-span** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/time-span/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/time-span/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · X [@Kikobeats](https://x.com/Kikobeats)
npm package: @kikobeats/use-query-state
Description: React hook to set/retrieve state from URL query string
Author: Kiko Beats
Latest version: 1.2.2

# use-query-state

> React hook for sharing state via URL.

## Installation

```bash
$ npm install @Kikobeats/use-query-state --save
```

## Usage

### Get query state

Just get it from `window.location.search`

```jsx
const [query, setQuery] = useQueryState()
```

### Pass a initial query state

This is especially useful for Server-side Rendering (SSR), when the initial query state will depends on the incoming request.

```jsx
const [query, setQuery] = useQueryState(ssrQuery)
```

### Transform the query state

Sometimes you want to modify the `window.location.search` for anything you need for.

```jsx
const safeDecode = value => {
  try {
    return decodeURIComponent(value)
  } catch (_) {
    return value
  }
}

const [query, setQuery] = useQueryState(undefined, parsedQuery =>
  Object.entries(parsedQuery).reduce((acc, [key, value]) => {
    acc[key] = safeDecode(value)
    return acc
  }, {})
)
```

## Integration

### for Next.js

Since [Next.js doesn't support ES Modules yet](https://github.com/vercel/next.js/issues/706), you need to install [`next-transpile-modules`](https://github.com/martpie/next-transpile-modules) in order to make possible use the hook on Next.js:

```js
const withTM = require('next-transpile-modules')(['@kikobeats/use-query-state'])

const nextConfig = {}

module.exports = withTM(withOffline(nextConfig))
```

### for Gatsby

```jsx
import useQueryState from '@kikobeats/use-query-state/gatsby'
```

## License

**use-query-state** © [Kiko Beats](https://kikobeats.com), released under the [MIT](https://github.com/Kikobeats/use-query-state/blob/master/LICENSE.md) License.<br>
Authored and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/Kikobeats/use-query-state/contributors).

> [kikobeats.com](https://kikobeats.com) · GitHub [Kiko Beats](https://github.com/Kikobeats) · Twitter [@Kikobeats](https://twitter.com/Kikobeats)