open-index/open-npm huggingface dataset:
npm package: @lpgroup/docs
Description: MDX parser with styles
Latest version: 1.10.2

# @lpgroup/docs

MDX parser library that returns a styled JSX.

## Contents

- [Getting Started](#getting-started)
- [Installation](#installation)
- [MDX Setup](#mdx-setup)

## Getting Started

The objective of this library is to parse MDX files and convert them into a ready-made _'documentation format'_.

```sh
yarn create vite
```

## Installation

To install this library, we can run in the command line.

```sh
# via yarn
yarn add @lpgroup/docs

# via npm
npm install --save @lpgroup/docs

```

# MDX Setup

```
import React from "react";
import LPDocs, { DocsSkeleton } from "@lpgroup/docs";
import { SampleLogo, Footer } from "./custom/SampleLogo";
const systemFont = `Raleway, Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif`;

const typhographySettings = {
  h1: {
    fontSize: "2.2rem",
    fontWeight: 600,
    fontFamily: systemFont,
    color: "#3cf",
  },
  h2: {
    fontSize: "1.5rem",
    fontWeight: 500,
    fontFamily: systemFont,
  },

  h3: {
    fontSize: "1.3rem",
    fontWeight: 500,
    fontFamily: systemFont,
  },
  h4: {
    fontSize: "1rem",
    fontWeight: 500,
  },
  body1: {
    lineHeight: 1.7,
    fontFamily: systemFont,
  },
  body2: {
    "fontSize": 15,
    "fontFamily": systemFont,
    "&:hover": {
      color: "#6969ff",
    },
  },
};

const Pages = React.lazy(() => import("./pages/v1"));

function App() {
  return (
    <LPDocs
      Logo={SampleLogo}
      Footer={Footer}
      sideBarHeight={60}
      isAuth={true}
      font={systemFont}
      textAlign={"justify"}
      typhography={typhographySettings}
    >
      <React.Suspense fallback={<DocsSkeleton />}>
        <Pages />
      </React.Suspense>
    </LPDocs>
  );
}

export default App;


```

#### Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup)

#### License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/feathers-admin-services
Description: Healthy and ready propbe services needed by kubernetes (k8s).
Latest version: 1.10.2

# @lpgroup/feathers-admin-services

[![npm version](https://badge.fury.io/js/%40lpgroup%2Ffeathers-admin-services.svg)](https://badge.fury.io/js/%40lpgroup%2Ffeathers-admin-services) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/feathers-admin-services/badge.svg)](https://snyk.io/test/npm/@lpgroup/feathers-admin-services)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

General feathersjs admin services

## Install

Installation of the npm

```sh
npm install @lpgroup/feathers-admin-services
```

## Usage

In `src/servies/index.js`

```js
const { ready, healthy } = require("@lpgroup/feathers-admin-services");

app.configure(log);
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/feathers-auth-service
Description: Services and hooks to handle auth, user and organisations in feathersjs.
Latest version: 1.10.2

# @lpgroup/feathers-auth-service

[![npm version](https://badge.fury.io/js/%40lpgroup%2Ffeathers-auth-service.svg)](https://badge.fury.io/js/%40lpgroup%2Ffeathers-auth-service) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/feathers-auth-service/badge.svg)](https://snyk.io/test/npm/@lpgroup/feathers-auth-service)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Services and hooks to handle auth, user and organisations in feathersjs.

## Install

Installation of the npm

```sh
npm install @lpgroup/feathers-auth-service
```

## Example

```js
const auth = require("@lpgroup/feathers-auth-service");
```

## API

### `xxx`

#### `xxx(xxx)`

```js
xxx(xxx);
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/feathers-k8s-probe-services
Description: Healthy and ready propbe services needed by kubernetes (k8s).
Latest version: 1.10.2

# @lpgroup/feathers-k8s-probe-services

[![npm version](https://badge.fury.io/js/%40lpgroup%2Ffeathers-k8s-probe-services.svg)](https://badge.fury.io/js/%40lpgroup%2Ffeathers-k8s-probe-services) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/feathers-k8s-probe-services/badge.svg)](https://snyk.io/test/npm/@lpgroup/feathers-k8s-probe-services)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Kubernetes (k8s) probe services for Feathers exposed on /healthy and /ready

They will both return 404 and the text specified in the config file.
Will start to send 200 ok after `app.set("status").ready = "OK"` is
executed

## Install

Installation of the npm

```sh
npm install @lpgroup/feathers-k8s-probe-services
```

## Usage

In `config/default.json` add the following.

```json
{
  "status": {
    "ready": "NOT-STARTED"
  }
}
```

In `src/servies/index.js`

```js
const { ready, healthy } = require("@lpgroup/feathers-k8s-probe-services");

app.configure(ready);
app.configure(healthy);
```

In `src/index.js`

```js
server.on("listening", async () => {
  app.set("status").ready = "OK";
});
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/feathers-mongodb-hooks
Description: Hooks for feathers-mongo.
Latest version: 1.10.2

# @lpgroup/feathers-mongodb-hooks

[![npm version](https://badge.fury.io/js/%40lpgroup%2Ffeathers-mongodb-hooks.svg)](https://badge.fury.io/js/%40lpgroup%2Ffeathers-mongodb-hooks) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/feathers-mongodb-hooks/badge.svg)](https://snyk.io/test/npm/@lpgroup/feathers-mongodb-hooks)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Collection of hooks to use togheter with fethers-mongodb

## Install

Installation of the npm

```sh
npm install @lpgroup/feathers-mongodb-hooks
```

## Example

```js
const auth = require("@lpgroup/feathers-mongodb-hooks");
```

## API

### `xxx`

#### `xxx(xxx)`

```js
xxx(xxx);
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/feathers-plugins
Description: Collection of feathers plugins.
Latest version: 1.10.2

# @lpgroup/feathers-plugins

[![npm version](https://badge.fury.io/js/%40lpgroup%2Ffeathers-plugins.svg)](https://badge.fury.io/js/%40lpgroup%2Ffeathers-plugins) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/feathers-plugins/badge.svg)](https://snyk.io/test/npm/@lpgroup/feathers-plugins)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Collection of feather plugins

## Install

Installation of the npm

```sh
npm install @lpgroup/feathers-plugins
```

## Usage

`onPluginsReady()` - resolves plugins promises

```js
import { onPluginsReady } from "@lpgroup/feathers-plugins";

onPluginsReady().then(() => {
  // action
});
```

`onPluginReady(pluginName)` - resolves a single plugin promise

```js
onPluginReady("mongodb").then((plugin) => {
  // action
});
```

`addPluginWithOptions(pluginName, plugin, options)` - initializes a plugin

```js
import { addPluginWithOptions, mongodb, nats, sync, axios } from "@lpgroup/feathers-plugins";

function setupPlugins(app) {
  addPluginWithOptions("mongodb", mongodb, { uri: app.get("mongodb") });
  addPluginWithOptions("nats", nats, app.get("nats"));
  addPluginWithOptions("axios", axios, {});
  addPluginWithOptions("sync", sync, { app });
}

app.configure(setupPlugins);
```

## API

### `xxx`

#### `xxx(xxx)`

```js
xxx(xxx);
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/ghostscript
Description: Wrapping ghostscript cli tool
Latest version: 1.10.2

# ghostscript

[![npm version](https://badge.fury.io/js/%40lpgroup%2Fghostscript.svg)](https://badge.fury.io/js/%40lpgroup%2Fghostscript) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/ghostscript/badge.svg)](https://snyk.io/test/npm/@lpgroup/ghostscript)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Flatten and optimize PDF with shell command Ghostscript `gsx`.

## Install

The npm module requires shell command Ghostscript to be installed on the machine.

```sh
# OSX
brew install ghostscript

# Alpine
apk update
apk add imagemagick ghostscript-fonts ghostscript

# Debian/ubuntu
apt-get update
apt-get install ghostscript
```

Installation of the npm

```bash
npm install @lpgroup/ghostscript
```

## Example

```js
const { readfilesync, writeFile } = require("fs");
const { resolve } = require("path");
const { optimize } = require("@lpgroup/ghostscript");

const fileIn = resolve("./test/flytt_uppdrag.pdf");
const fileOut = resolve("./test/flytt_uppdrag_optimized.pdf");

const input = readfilesync(fileIn);
optimize({ input }).then((output) => {
  writeFile(fileOut, output, "binary");
});
```

## API

### `env DEBUG`

This package uses the [debug](https://www.npmjs.com/package/debug) npm. Debug messages are printed to stdout if the follwoing is set.

```bash
export DEBUG=ghostscript
```

### `optimize({options})`

Following are all values that can be used in options and the default values that are used if none is entered.

```js
optimize({
  input,
  compressFonts: true,
  embedAllFonts: true,
  subsetFonts: true,
  dpi: 300,
  colorConversionStrategy: "RGB",
});
```

## Raw shell command

Below is the shell command executed by node, if you'd like to optimize it further yourself. Credit goes to
Matt DesLauriers and the repo http://github.com/mattdesl/gsx-pdf-optimize

Removed according to https://stackoverflow.com/questions/49686527/ghostscritpt-converted-file-not-view-able-in-adobe-reader
-dPDFSETTINGS=/screen
-dCompatibilityLevel=1.5

```sh
cat test/large-file.pdf | \
gsx -sDEVICE=pdfwrite \
-dNOPAUSE \
-dQUIET \
-dBATCH \
-dSubsetFonts=true \
-dCompressFonts=true \
-dEmbedAllFonts=true \
-sOutputFile=- - > flytt_uppdrag_optimized.pdf
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/utils
Description: Collection of utils.
Latest version: 1.10.2

# @lpgroup/utils

[![npm version](https://badge.fury.io/js/%40lpgroup%2Futils.svg)](https://badge.fury.io/js/%40lpgroup%2Futils) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/utils/badge.svg)](https://snyk.io/test/npm/@lpgroup/utils)
[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Collection of utils functions

## Install

Installation of the npm

```sh
npm install @lpgroup/utils
```

## Example

```js
const auth = require("@lpgroup/utils");
```

## API

### `xxx`

#### `xxx(xxx)`

```js
xxx(xxx);
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpgroup/vite-plugin-replace
Description: Vite plugin to replace string in all code files
Latest version: 1.10.2

# vite-plugin-replace

Replace a string with another string in all code files.
Primary needed for the entry-point index.html file.

## Usage

```js
// vite.config.ts
import replace from "@lpgroup/vite-plugin-replace";

const replaceArr = [
  { src: "http://localhost:8189/harper-0.0.1.umd.js", production: "/harper/harper-0.0.1.umd.js" },
];

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  return {
    plugins: [
      // ...otherplugins
      replace(replaceArr, mode),
    ],
  };
});
```
npm package: @lpgroup/yup
Description: Collection of yup validation functions.
Latest version: 1.10.2

# @lpgroup/yup

[![npm version](https://badge.fury.io/js/%40lpgroup%2Fyup.svg)](https://badge.fury.io/js/%40lpgroup%2Fyup) [![Known Vulnerabilities](https://snyk.io/test/npm/@lpgroup/yup/badge.svg)](https://snyk.io/test/npm/@lpgroup/yup)[![Licence MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) [![codecov](https://codecov.io/gl/lpgroup/lpgroup/branch/master/graph/badge.svg?token=RRZ6GDUQXT)](https://codecov.io/gl/lpgroup/lpgroup)

Collection of yup validation and helper functions for projects based on feathersjs.

## Install

Installation of the npm

```sh
npm install @lpgroup/yup
```

## Example

```js
const yup = require("@lpgroup/yup");

const schema = { key: yup.string().required() };
```

### Hooks

```js
/* xxx.yup.js */
const cy = require("@lpgroup/yup");

const requestSchema = {
  _id: cy.uuid().required(),
  alias: cy.string().required(),
  name: cy.string().required(),
  createdAt: cy.timestamp().defaultNull(),
  changedAt: cy.timestamp().defaultNull(),
};

const dbSchema = {
  added: cy.changed(),
  changed: cy.changed(),
  owner: cy.owner(),
};

module.exports = cy.buildValidationSchema(requestSchema, dbSchema);
module.exports.requestSchema = requestSchema;
```

```js
/* xxx.service.js */
const { Xxx } = require("./xxx.class");
const hooks = require("./xxx.hooks");
const schema = require("./xxx.yup");

module.exports = (app) => {
  const options = { id: "alias", schema };
  app.use("/xxx", new Xxx(options, app));
  const service = app.service("xxx");
  service.hooks(hooks);
};
```

```js
/* xxx.hooks.js */
const { validReq } = require("@lpgroup/yup");
const { validDB } = require("@lpgroup/yup");

module.exports = {
  before: {
    create: [validReq(), changeData(), validDB()],
    update: [validReq(), changeData(), validDB()],
    patch: [validReq(), changeData(), validDB()],
  },
};
```

## API

### `general`

### `hooks`

#### `validReq(objSchema)`

```js
validReq(xxx);
```

#### `validDB(objSchema)`

```js
validDB(xxx);
```

#### `yup.array(objSchema)`

```js
const schema = { key: yup.array({ key: yup.string() }).required() };
```

## Development

When developing this NPM your can patch yup to give better error message.

```sh
npm run patch-package
```

## Contribute

See [contribute](https://gitlab.com/lpgroup/lpgroup/-/blob/master/README.md#contribute)

## License

MIT - See [licence](https://gitlab.com/lpgroup/lpgroup/-/blob/master/LICENSE.md)
npm package: @lpha/plugin-aws-k8s
Description: Set up a Kubernetes cluster on AWS easily
Author: Krzysztof Miemiec
Latest version: 0.1.2

# @lpha/plugin-aws-k8s
Utility that simplifies Kubernetes@AWS cluster management

### How to cluster

1. Download & install a lot of dependencies (sorry for that):
   * [aws-cli](https://aws.amazon.com/cli/)
   * [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
   * [eksctl](https://eksctl.io)
   * [aws-iam-authenticator](https://docs.aws.amazon.com/eks/latest/userguide/configure-kubectl.html)
   * [Node.js](https://nodejs.org/) & Yarn (`npm i -g yarn`)
   * alpha-k8s (for now, just [download the repo](https://github.com/headline-1/alpha-k8s/archive/master.zip) and run `yarn`, btw you'll need Node.js and Yarn - that's a lot of deps, sorry!)
2. Create cluster config file `kube.json`
    ```json
    {
      "name": "h1-eks",
      "region": "eu-west-1",
      "nodesMin": 2,
      "nodesMax": 5,
      "domain": "h1.com"
    }
    ```
3. Set correct AWS credentials with `aws configure`
4. Run `yarn setup`. Wait 5-15 minutes. Eksctl will do it's magic.
5. Optionally, run `yarn start install [module1] [module2]` if you want to install things such as "dashboard", "autoscaler", "dns" automatically.
6. Run `yarn create-namespace [namespace-name]`. This will create a namespace in your cluster, set up AWS roles, policies and users, K8s roles, groups and role bindings, proper K8s configuration files and AWS access keys for namespace admins and CI (deployments).
7. Access the cluster namespace with newly created resources: Go to newly created folder `./namespaces/[namespace-name]` to find the credentials. You can do `export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... KUBEFILE=./namespaces/[namespace-name]/admin.config.yaml` and manage your namespace using `kubectl` commands from now on.

For now the whole solution looks crappy, but well, it saved me some time, I hope it'll save your too.
npm package: @lphal/vite-plugin-git-info
Description: get git info or generate file for git info
Author: @lphal
Latest version: 1.0.5

# vite-plugin-git-info

Generate git information based on [git-rev-sync](https://www.npmjs.com/package/git-rev-sync), and output git information to file.

## Install

```sh
npm install @lphal/vite-plugin-git-info -D
```

## Usage

```ts
import { defineConfig } from 'vite'
import { gitInfo, gitInfoToFile } from '@lphal/vite-plugin-git-info'

export default defineConfig({
    plugins: [
        gitInfoToFile()
    ]
})
```

## API

### gitInfo

An Object has the following properties:

- **gitInfo.branch: () => string**

        branch name, such as `master` or `dev`.

- **gitInfo.short: () => string**

        short commit hash for latest commit, such as `7d7j3t`.

- **gitInfo.date: () => Date**

        latest commit date, such as `2021-04-27T09:12:23.000Z`.

### gitInfoToFile

An vite plugin, output git information to file. It will generate a file named `git-info.json` in `dist` folder by default.

type: `(options?: { fileName?: string }) => Plugin`
npm package: @lphal/watermark
Description: 给页面添加水印(纯js版), 移植自ant-design
Author: @lphal
Latest version: 1.0.1

# AWatermark 水印

用于给页面添加水印, 移植自 [ant design Watermark组件](https://ant.design/components/watermark-cn)

## 安装

使用 npm 或 yarn 安装

```bash
npm install @lphal/watermark --save
```

```js
import AWatermark from '@lphal/watermark';
```

script标签引入

```js
<script src="watermark.umd.js"></script>
```

## 使用

```js
new AWatermark({
  content: '水印内容',
}) 
```

## API

### AWatermark 构造函数参数

| 参数  | 说明  | 类型 | 默认值 |
|---|---|---|---|
| container  | 放置水印的容器，默认body  | HTMLElement | document.body |
| content  | 水印内容  | string \| string[] | '' |
| width  | 水印的宽度，`content` 的默认值为自身的宽度, `image`的默认宽度为120  | number | - |
| height  | 水印的高度，`content` 的默认值为自身的高度，`image`的默认高度为64  | number | - |
| rotate  | 水印旋转角度  | number | -22 |
| zIndex  | 水印元素的层级  | number | 9 |
| image | 图片源，建议导出 2 倍或 3 倍图，优先级高 (支持 base64 格式) | string | - |
| font | 文字样式 | [Font](#Font) | [Font](#Font) |
| gap | 水印之间的间距 | [number, number] | [100, 100] |
| offset | 水印距离容器左上角的偏移量，默认为 gap/2 | [number, number] | [gap[0]/2, gap[1]/2] |

### Font

| 参数  | 说明  | 类型 | 默认值 |
|---|---|---|---|
| color | 文字颜色 | string | rgba(0,0,0,.15)	|
| fontSize | 文字大小 | number | 16 |
| fontWeight | 文字粗细 | normal \| light \| weight \| number | normal |
| fontFamily | 文字字体 | string | sans-serif |
| fontStyle | 文字样式 | none \| normal \| italic \| oblique | normal |

### AWatermark 实例方法
| 方法名  | 说明  | 类型 |
|---|---|---|
| init | 初始化水印 | () => void |
| renderWatermark | 渲染水印 | () => void |
| destroyWatermark | 销毁水印 | () => void |
npm package: @lpi/docusaurus-theme-search-typesense
Description: Typesense search component for Docusaurus.
Latest version: 0.21.0

# `docusaurus-theme-search-typesense`

[Typesense](https://typesense.org) search component for Docusaurus powered documentation sites.

This is a fork of the awesome [@docusaurus/theme-search-algolia](https://www.npmjs.com/package/@docusaurus/theme-search-algolia) library customized to work with Typesense.

#### About Typesense

If you're new to Typesense, it is an **open source search engine** that is simple to use, run and scale, with clean APIs and documentation.

Think of it as an open source alternative to Algolia and an easier-to-use, batteries-included alternative to ElasticSearch. Get a quick overview from [this guide](https://typesense.org/guide/).

## Documentation

Read detailed step-by-step instructions on how to first setup the DocSearch scraper and then install this plugin here: https://typesense.org/docs/latest/guide/docsearch.html.

## Help

If you have any questions or run into any problems, please create a Github issue and we'll try our best to help.
npm package: @lpi/multireducer
Description: A utility to wrap many copies of a single Redux reducer into a single key-based reducer.
Author: Erik Rasmussen
Latest version: 3.2.6

# multireducer

[![NPM Version](https://img.shields.io/npm/v/multireducer.svg?style=flat-square)](https://www.npmjs.com/package/multireducer)
[![NPM Downloads](https://img.shields.io/npm/dm/multireducer.svg?style=flat-square)](https://www.npmjs.com/package/multireducer)
[![Build Status](https://img.shields.io/travis/erikras/multireducer/master.svg?style=flat-square)](https://travis-ci.org/erikras/multireducer)

`multireducer` is a utility to wrap many copies of a single Redux reducer into a single key-based reducer.

## Installation

```
npm install --save multireducer
```

## Why?

There are times when writing a Redux application where you might find yourself needing multiple copies of the same reducer. For example, you might need more than one list of the same type of object to be displayed. Rather than make a big reducer to handle list `A`, `B`, and `C`, and have action creators either in the form `addToB(item)` or `addToList('B', item)`, it would be easier to write one "list" reducer, which is easier to write, reason about, and test, with a simpler `add(item)` API.

However, Redux won't let you do this:

```javascript
import list from './reducers/list';

const reducer = combineReducers({
  a: list,		// WRONG
  b: list,		// WRONG
  c: list		// WRONG
});
```

Each of those reducers is going to respond the same to every action.

This is where `multireducer` comes in. Multireducer lets you mount the same reducer any number of times in your Redux state tree, as long as you pass the key that you mounted it on to your connected component.


Read the full [API Documentation](/docs)

## Working Example

The [react-redux-universal-hot-example](https://github.com/erikras/react-redux-universal-hot-example) project uses `multireducer`. See its [`reducer.js`](https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/redux/modules/reducer.js), which combines the plain vanilla [`counter.js`](https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/redux/modules/counter.js) [duck](https://github.com/erikras/ducks-modular-redux), to a multireducer. The [`CounterButton.js`](https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/components/CounterButton/CounterButton.js) connects to the multireducer, and the [`Home.js`](https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/containers/Home/Home.js) calls `<CounterButton/>` with a `multireducerKey` prop.

[Example](https://github.com/jsdmc/react-redux-router-crud-boilerplate) with [multiple counters](https://github.com/jsdmc/react-redux-router-crud-boilerplate/blob/master/src/redux-base/modules/reducer.js) and [ducks](https://github.com/erikras/ducks-modular-redux) [composition](https://github.com/jsdmc/react-redux-router-crud-boilerplate/blob/master/src/redux-base/modules/customCounter.js).