open-index/open-npm huggingface dataset:
npm package: @nv4re/koa-decorator
Description: @route decorator for koa-router (fork from https://github.com/gwuhaolin/koa-router-decorator)
Latest version: 2.0.1

# koa-decorator
@route decorator for koa-router

## Use
install by:
```bash
npm i @nv4re/koa-decorator
```
then use in code:
```js
import {HttpMethod, route} from 'koa-decorator';

@route('/monitor')
export default class MonitorCtrl{

  @route('/alive', HttpMethod.GET)
  async alive(ctx) {
    ctx.body = {
      data: true,
    };
  }
}
```
register to router:
```js
import {load} from 'koa-decorator';
const apiRouter = load(path.resolve(__dirname, 'route'), '.route.js');
app.use(apiRouter.routes()).use(apiRouter.allowedMethods());
```

## Use auth middleware
```js
import {HttpMethod, route} from 'koa-decorator';

function auth(ctx) {
  if(!ctx.auth){
      ctx.response.status = 401;
  }
}

@route('/monitor')
export default class MonitorCtrl {

  @route('/alive', HttpMethod.GET,auth)
  async alive(ctx) {
    ctx.body = {
      data: true,
    };
  }
}
```

## Return data direct
The following code has the same effect as above:
```js
@route('/monitor')
export default class MonitorCtrl {

  @route('/alive', HttpMethod.GET,auth)
  async alive() {
    return {
      data: true,
    };
  }
}
```
npm package: @nvae/doc
Description: Markdown to HTML
Author: rchdg@qq.com
Latest version: 1.1.1

### @nvae/doc

@nvae/doc 是一个命令行工具，用于使用GitHub/Git和Markdown构建漂亮的html文档或博客。

![预览](https://raw.githubusercontent.com/nvae/doc/master/src/assets/img.png)

### 使用说明

#### 使用npm安装： 

```
npm install -g @nvae/doc
```

`@nvae/doc` 是一个markdown转换工具。它将可以通过命令行形式来构建一个html文档或者博客。

#### 使用单个md文件生成html文档：

**doc -f 文件名**

```
doc -f ./name.md
```

#### 使用文件夹生成带菜单的html文档：

+ 默认

 ```
 doc
 ```

+ 指定目录

```
doc -r ./dir
```

#### 设置文档标题

```
doc -t 文档标题
```

#### 设置输出目录

默认： `dist`

```
doc -o build
```

#### 查看帮助

```
doc -h
```

#### 查看版本

```
doc --version
```

### 关于

作者：@nvae

Email: rchdg@qq.com
npm package: @nvae/file-dedupe
Description: 检测目录中的重复文件
Author: rchdg@qq.com
Latest version: 1.0.3


### 介绍


检测给定目录中的重复文件, 采用哈希算法对比文件是否相同。


### 全局安装 

```bash
npm i -g  @nvae/file-dedupe
```


### 用法

批量检测给定目录重复文件并将结果输出到指定位置

```bash
nvae-dedupe -d ./path/to/ -o repeat.json
```

批量检测给定目录重复文件并删除
```bash
nvae-dedupe -d ./path/to/ -r
```


### 命令行选项

```bash

  -h, --help     显示帮助信息                                             [布尔]
  -d, --dir      搜索目录                                        [字符串] [必需]
  -r, --remove   是否删除重复文件                         [布尔] [默认值: false]
  -o, --output   输出结果文件,默认在控制输出结果                        [字符串]
  -v, --version  显示版本号  
``` 

问题反馈：rchdg@qq.com
npm package: @nvandoorn/naive
Description: A naive NoSQL database
Author: Nicholas Van Doorn
Latest version: 1.3.2

# naive

![build status](https://api.travis-ci.org/nvandoorn/naive.svg?branch=master "Build Status")

[Read the docs](https://nvandoorn.github.io/naive/)

A small NoSQL database with an API similar to Firebase backed by a static JSON file.

Useful for prototyping or situations where size is small and data integrity is not that important
npm package: @nvandoorn/naive-core
Description: A naive NoSQL database
Author: Nicholas Van Doorn
Latest version: 1.5.0

# naive

![build status](https://api.travis-ci.org/nvandoorn/naive.svg?branch=master "Build Status")

[Read the docs](https://nvandoorn.github.io/naive/)

A small NoSQL database with an API similar to Firebase backed by a static JSON file.

Useful for prototyping or situations where size is small and data integrity is not that important
npm package: @nvanexan/fw-cli
Description: A CLI for Fieldworkers
Author: Nicholas Van Exan
Latest version: 0.0.8

# fw-cli

A CLI for Fieldworkers

## Install

```bash
$ npm install --global @nvanexan/fw
```

## CLI

```
$ fw --help

  Usage
    $ fw <input>
    $ fw set-config --togglToken=TOKEN --wid=WID
    $ fw tog

  Options
    --togglToken  Your Toggl token
    --wid         Your Toggl workspace id

  Examples
    $ fw set-config --togglToken=TOKEN --wid=WID
    $ fw tog
```

## Commands

### tog

```
$ fw tog start     starts a toggl timer
$ fw tog stop      stops a toggl timer
$ fw tog create    creates a toggl time entry
$ fw tog update    update toggl time entries rom past week
$ fw tog timer     get current toggl timer
```

### set-config

The `set-config` command allows you to set certain configuration variables you want the CLI to make use of.
npm package: @nvarner/monads
Description: Type safe Option, Result, and Either types; inspired by Rust
Author: Slavo Vojacek and Nathan Varner
Latest version: 0.5.1

# 👻 Monads

Type safe Option, Result, and Either types; inspired by Rust. Fork of
[@hqoss/monads](https://www.npmjs.com/package/@hqoss/monads) ([source](https://github.com/hqoss/monads))

## Table of contents

-   [⏳ Install](#-install)

    -   [Node.js and the Browser](#nodejs-and-the-browser)

-   [📝 Usage](#-usage)

    -   [`Option<T>`](#optiont)
    -   [`Result<T, E>`](#resultt-e)
    -   [`Either<L, R>`](#eitherl-r)
    -   [API Docs](#api-docs)

## ⏳ Install

### Node.js and the Browser

```bash
npm install @nvarner/monads
```

**⚠️ NOTE:** The project is configured to target `ES2018` and the library uses `commonjs` module resolution.

## 📝 Usage

### `Option<T>`

```typescript
import { Option, Some, None } from "@nvarner/monads"

function divide(numerator: number, denominator: number): Option<number> {
  if (denominator === 0) {
    return None
  } else {
    return Some(numerator / denominator)
  }
};

// The return value of the function is an option
const result = divide(2.0, 3.0)

// Pattern match to retrieve the value
const message = result.match({
  some: res => `Result: ${res}`,
  none: "Cannot divide by 0",
})

console.log(message) // "Result: 0.6666666666666666"
```

### `Result<T, E>`

```typescript
import { Result, Ok, Err } from "@nvarner/monads"

function getIndex(values: string[], value: string): Result<number, string> {
  const index = values.indexOf(value)

  switch (index) {
    case -1:
      return Err("Value not found")
  default:
    return Ok(index)
  }
}

console.log(getIndex(["a", "b", "c"], "b")) // Ok(1)
console.log(getIndex(["a", "b", "c"], "z")) // Err("Value not found")
```

### `Either<L, R>`

```typescript
import { Either } from "@nvarner/monads"

function getLabel(uncertainDate: Either<Date, string>) {
  return uncertainDate.match({
    left: date => date.toLocaleDateString(),
    right: text => `<abbr title="${text}">an uncertain date</abbr>`,
  })
}
```

### API Docs

[See full API Documentation here](https://gitlab.com/nvarner/typescript-monads/-/blob/master/docs/globals.md).
npm package: @nvax/portainer-deploy
Description: Deploys a docker-compose.yml as a stack to a portainer instance
Author: novarx @novarx
Latest version: 1.1.1

partainer-deploy
=================

A small CLI to deploy a docker-compose file to a [Portainer](https://www.portainer.io/) instance.

[![Latest Release](https://gitlab.com/nvax/portainer-deploy/-/badges/release.svg)](https://www.npmjs.com/package/@nvax/portainer-deploy)
[![codecov](https://codecov.io/gitlab/nvax/portainer-deploy/graph/badge.svg?token=GISRSV96RO)](https://codecov.io/gitlab/nvax/portainer-deploy) 

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)
<!-- tocstop -->

# Usage
<!-- usage -->
```sh-session
$ npm install -g @nvax/portainer-deploy
$ portainer-deploy COMMAND
running command...
$ portainer-deploy (--version)
@nvax/portainer-deploy/1.1.1 linux-x64 node-v20.11.0
$ portainer-deploy --help [COMMAND]
USAGE
  $ portainer-deploy COMMAND
...
```
<!-- usagestop -->

# Commands
<!-- commands -->
* [`portainer-deploy help [COMMANDS]`](#portainer-deploy-help-commands)
* [`portainer-deploy stack [FILE]`](#portainer-deploy-stack-file)

## `portainer-deploy help [COMMANDS]`

Display help for portainer-deploy.

```
USAGE
  $ portainer-deploy help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for portainer-deploy.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.8/src/commands/help.ts)_

## `portainer-deploy stack [FILE]`

Deploys Docker Compose Files to Portainer

```
USAGE
  $ portainer-deploy stack [FILE] --endpoint <value> --password <value> --stack <value> --url <value>
    --username <value> [--env_link <value> | --envs <value>]

ARGUMENTS
  FILE  [default: docker-compose.yml] docker-compose file to deploy

FLAGS
  --endpoint=<value>  (required) portainer endpoint id
  --env_link=<value>  local variables to be sent to portainer stack, i.e.: "MY_ENV_VAR, MY_OTHER_ENV_VAR
  --envs=<value>      portainer env variables as json-array
  --password=<value>  (required) portainer password
  --stack=<value>     (required) portainer stack id
  --url=<value>       (required) portainer base url i.e.: https://portainer.example.com
  --username=<value>  (required) portainer username

DESCRIPTION
  Deploys Docker Compose Files to Portainer
```

_See code: [src/commands/stack/index.ts](https://gitlab.com/nvax/portainer-deploy/blob/v1.1.1/src/commands/stack/index.ts)_
<!-- commandsstop -->