open-index/open-npm huggingface dataset:
npm package: @nuonuonuonuoyan/hooks
Description: 极简的react-hooks状态管理库
Author: yaso
Latest version: 1.0.70

[示例查看 http://qinwang.battlebanpick.com/hooks](http://qinwang.battlebanpick.com/hooks)

## 安装

> `yarn add @nuonuonuonuoyan/hooks`或`npm i @nuonuonuonuoyan/hooks`

## useStore

> 一个极简的全局共享状态管理工具

对于**子组件**和**父组件**以及层级**较为简单**的共享状态的情况，仍然强烈推荐直接使用 `props` 传递属性给子组件。 `useStore` 适合的是在**距离较远**的组件之间进行状态共享。

## API

```
import { useStore } from '@nuonuonuonuoyan/hooks';

const Demo = () => {
    const [state, setState] = useStore(namespace, initState, options);

    ...
    ...
}


```

### Params

| 参数      | 说明                                 | 类型      | 默认值 |
| --------- | ------------------------------------ | --------- | ------ |
| namespace | 命名空间，每一组状态**命名空间唯一** | `string`  | global |
| initState | 同 useState，初始值                  | `any`     | -      |
| options   | 额外的配置项                         | `Options` | -      |

### Options

| 参数           | 说明                                                                                            | 类型     | 默认值 |
| -------------- | ----------------------------------------------------------------------------------------------- | -------- | ------ |
| asyncNameSpace | 异步加载的组件需要添加该属性，并且**传入的值需要和 namespace 的值相同**，否则无法获取到共享状态 | `string` | -      |

### Result

| 参数     | 说明                                | 类型         |
| -------- | ----------------------------------- | ------------ |
| state    | 全局共享的状态值                    | `any`        |
| setState | 改变共享状态的函数，用法同 useState | `() => void` |

## useLazyLoad

> 图片懒加载

```
import { useLazyload } from '@nuonuonuonuoyan/hooks';
```

## API

### Params

| 参数    | 说明            | 类型    | 默认值 |
| ------- | --------------- | ------- | ------ |
| domList | 传入的 dom 集合 | `dom[]` | []     |
npm package: @nuonuonuonuoyan/react-pulldown-refresh
Description: 通用的下拉刷新组件
Author: yaso
Latest version: 1.0.70

[示例查看 http://qinwang.maojiemao.com/refresh](http://qinwang.maojiemao.com/refresh)

## 安装

`yarn add @nuonuonuonuoyan/react-pulldown-refresh`或`npm i @nuonuonuonuoyan/react-pulldown-refresh`

```
import PulldownRefresh from '@nuonuonuonuoyan/react-pulldown-refresh'
```

## API

| 属性           | 说明                             | 类型                                                                            | 默认值     |
| -------------- | -------------------------------- | ------------------------------------------------------------------------------- | ---------- |
| headClass      | 提示文案的容器类                 | `string`                                                                        |            |
| renderText     | 根据下拉状态自定义下拉提示的文案 | (<a href='#status' style='text-decoration: underline;'>status</a>) => ReactNode |            |
| pullingText    | 下拉的提示文案                   | `string` \| `ReactNode`                                                         | 用力下拉   |
| canReleaseText | 释放可触发刷新的文案             | string \| `ReactNode`                                                           | 松手可刷新 |
| refreshingText | 正在刷新，即正在请求接口的文案   | string \| `ReactNode`                                                           | 刷新中     |
| completeText   | 刷新完成的展示文案               | string \| `ReactNode`                                                           | 刷新完成   |
| onRefresh      | 刷新时执行的函数                 | `() => Promise`                                                                 |            |
| disabled       | 禁止下拉刷新                     | `boolean`                                                                       | false      |

### <a id='status'>status</a>

| 说明                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------- |
| status 的几个状态：<br /> pulling - 下拉中 <br /> canRelease - 下拉临界值，松手后可触发刷新 <br /> refreshing - 刷新中 <br /> complete - 刷新完成 |
npm package: @nuonuonuonuoyan/react-swiper
Description: H5通用轮播图和大图查看组件
Author: yaso
Latest version: 1.0.70

## 基于 antd-modile + Swiper 封装的 H5（React 项目）通用业务场景的轮播 + 大图预览的组件

## 文档查看

http://qinwang.battlebanpick.com
npm package: @nupamore/eslint-config
Description: my config
Author: nupamore@gmail.com
Latest version: 1.0.0

# eslint-config
my config

```sh
yarn add -D @nupamore/eslint-config
```

```js
// .eslintrc.js
module.exports = {
  extends: ['@nupamore/eslint-config'],
}
```
npm package: @nupamore/stylelint-config
Description: my config
Author: nupamore@gmail.com
Latest version: 1.0.0

# stylelint-config
my config

```sh
yarn add -D @nupamore/stylelint-config
```

```js
// .stylelintrc.js
module.exports = {
  extends: ['@nupamore/stylelint-config'],
}
```
npm package: @nupt/sketch-fetch
Description: A fetch for sketch
Author: zhzxang
Latest version: 0.0.3

# @nupt/sketch-fetch

A [fetch](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) polyfill for sketch inspired by [unfetch](https://github.com/developit/unfetch). It is automatically included (when needed) when using [skpm](https://github.com/skpm/skpm).

## Installation

```bash
npm i -S @nupt/sketch-fetch
```

## Usage

```js
const fetch = require('@nupt/sketch-fetch')

fetch("https://google.com")
  .then(response => response.text())
  .then(text => console.log(text))
  .catch(e => console.error(e))
```

## extra add

upload file

```js
const fetch = require('sketch-fetch-complete')

fetch("https://google.com",{
  method: 'post',
  // filepath of local file
  formdata: path,
  // form parameters
  formParameters: {
    name: 'sample',
    author: 'wwsun',
  }
})
  .then(response => response.text())
  .then(text => console.log(text))
  .catch(e => console.error(e))
```
npm package: @nuptechs/nupidentity-cli
Description: NuPIdentity CLI - Integration wizard with visual function mapping
Author: NuPtechs
Latest version: 1.0.0

# @nupidentity/cli

CLI do NuPIdentity para integração visual de sistemas.

## Instalação

```bash
npm install -D @nupidentity/cli
```

## Comandos

### `npx nupidentity init`

Inicializa o NuPIdentity no seu projeto:

```bash
npx nupidentity init
```

Cria:
- Configurações no `.env`
- Arquivo `nupidentity.manifest.json`

### `npx nupidentity integrate`

Descobre funcionalidades do seu sistema e abre uma UI visual para revisão:

```bash
npx nupidentity integrate
```

Opções:
- `--port <porta>` - Porta do servidor local (padrão: 9090)
- `--no-open` - Não abre o navegador automaticamente
- `--openapi <path>` - Caminho para arquivo OpenAPI/Swagger

A UI permite:
- Visualizar funcionalidades descobertas
- Marcar/desmarcar funcionalidades
- Adicionar funcionalidades manualmente
- Salvar manifesto
- Sincronizar com NuPIdentity

### `npx nupidentity sync`

Sincroniza o manifesto com o servidor NuPIdentity:

```bash
npx nupidentity sync
```

Opções:
- `--manifest <path>` - Caminho do manifesto (padrão: nupidentity.manifest.json)

### `npx nupidentity status`

Verifica o status da integração:

```bash
npx nupidentity status
```

## Descoberta de Funcionalidades

O CLI descobre funcionalidades automaticamente de:

### 1. Decorators (Alta Confiança)

```typescript
import { NuPFunction } from '@nupidentity/sdk/decorators';

@NuPFunction('users.create', { 
  name: 'Criar Usuário', 
  category: 'Usuários' 
})
createUser(req, res) { ... }
```

### 2. OpenAPI/Swagger (Média Confiança)

Coloque um arquivo `openapi.json` ou `swagger.json` na raiz do projeto.

### 3. Manual (Via UI)

Adicione funcionalidades diretamente na UI de integração.

## Fluxo de Integração

```
1. npm install @nupidentity/sdk @nupidentity/cli
2. npx nupidentity init
3. Adicione decorators @NuPFunction no código
4. npx nupidentity integrate (revise na UI)
5. npx nupidentity sync
6. Configure usuários/permissões no painel NuPIdentity
```

## Variáveis de Ambiente

```env
NUPIDENTITY_ISSUER=https://identify.nuptechs.com
NUPIDENTITY_SYSTEM_API_KEY=sua-api-key
```
npm package: @nuptechs/nupidentity-sdk
Description: Official NuPIdentity SDK for easy OIDC/SSO integration - protect your app in 3 lines
Author: NuPtechs
Latest version: 1.0.0

# @nupidentity/sdk

SDK oficial do NuPIdentity para integração SSO/OIDC em aplicações Node.js.

## Instalação

```bash
npm install @nupidentity/sdk
```

## Uso Rápido (Express)

```typescript
import express from 'express';
import { init } from '@nupidentity/sdk/express';

const app = express();

const nup = await init(app, {
  issuer: process.env.NUPIDENTITY_ISSUER,
  clientId: process.env.NUPIDENTITY_CLIENT_ID,
  clientSecret: process.env.NUPIDENTITY_CLIENT_SECRET,
});

// Proteger rotas específicas
app.get('/api/admin', nup.requireAuth, (req, res) => {
  res.json({ user: req.user });
});

// Verificar permissões
app.get('/api/users', ...nup.ensurePermission('users.view'), (req, res) => {
  res.json({ users: [] });
});

app.listen(3000);
```

## Decorators para Mapeamento de Funcionalidades

Use decorators para marcar funcionalidades que serão sincronizadas com o NuPIdentity:

```typescript
import { NuPFunction, NuPProtected } from '@nupidentity/sdk/decorators';

class UserController {
  @NuPFunction('users.list', { name: 'Listar Usuários', category: 'Usuários' })
  listUsers(req, res) {
    // ...
  }

  @NuPFunction('users.create', { name: 'Criar Usuário', category: 'Usuários' })
  @NuPProtected('users.create')
  createUser(req, res) {
    // ...
  }
}
```

## Integração Completa

Para integração completa com descoberta automática de funcionalidades:

```bash
npm install -D @nupidentity/cli

# Inicializar projeto
npx nupidentity init

# Descobrir funcionalidades e abrir UI de integração
npx nupidentity integrate

# Sincronizar com NuPIdentity
npx nupidentity sync
```

## Variáveis de Ambiente

```env
NUPIDENTITY_ISSUER=https://identify.nuptechs.com
NUPIDENTITY_CLIENT_ID=seu-client-id
NUPIDENTITY_CLIENT_SECRET=seu-client-secret
NUPIDENTITY_SYSTEM_API_KEY=sua-api-key
```

## Documentação

Veja a documentação completa em [identify.nuptechs.com/docs](https://identify.nuptechs.com/docs)
npm package: @nupurprakash/lotide
Description: Various operations within arrays for learning purpose
Author: NupurPrakash
Latest version: 1.0.0

# Lotide

A mini clone of the [Lodash](https://lodash.com) library.

## Purpose

**_BEWARE:_ This library was published for learning purposes. It is _not_ intended for use in production-grade software.**

This project was created and published by me as part of my learnings at Lighthouse Labs. 

## Usage

**Install it:**

`npm install @nupurprakash/lotide`

**Require it:**

`const _ = require('@nupurprakash/lotide');`

**Call it:**

`const results = _.tail([1, 2, 3]) // => [2, 3]`

## Documentation

The following functions are currently implemented:

* `function1(head)`: to get the first element of an array
* `function2(tail)`: to get all the elements except first in array
* `function3(middle)`: to find the middle element in array
* `function4(eqArray)` : to compare two arrays
* `function5(assertEqualTest)` : to see if two arrays are similar
* `function6(assertArrayEqualTest)`:to compare arrays