open-index/open-npm huggingface dataset:
npm package: @opendnd/avataria
Description: A package for generating random avatars for Open DnD
Author: Drew Morris
Latest version: 0.5.0

# Avataria

[![NPM](https://nodei.co/npm/avataria.png?downloads=true&stars=true)](https://nodei.co/npm/avataria/)

This is a tool for randomly generating avatars for use in character sheets.

## Installation

You will need [node](https://nodejs.org/en/) and [npm](https://www.npmjs.com/) installed. Then do:

`npm install -g avataria`

## Generate an Avatar

`avataria`

Once you have installed avataria you can generate an avatar by simply running the following:

## Options

### race

`avataria --race human`

Currently there are 9 race available:

#### Dragonborn
![dragonborn-male](doc/dragonborn-male.svg)![dragonborn-female](doc/dragonborn-female.svg)

#### Dwarf
![dwarf-male](doc/dwarf-male.svg)![dwarf-female](doc/dwarf-female.svg)

#### Elf
![elf-male](doc/elf-male.svg)![elf-female](doc/elf-female.svg)

#### Gnome
![gnome-male](doc/gnome-male.svg)![gnome-female](doc/gnome-female.svg)

#### Half-Elf
![half-elf-male](doc/half-elf-male.svg)![half-elf-female](doc/half-elf-female.svg)

#### Half-Orc
![half-orc-male](doc/half-orc-male.svg)![half-orc-female](doc/half-orc-female.svg)

#### Halfling
![halfling-male](doc/halfling-male.svg)![halfling-female](doc/halfling-female.svg)

#### Human
![human-male](doc/human-male.svg)![human-female](doc/human-female.svg)

#### Tiefling
![tiefling-male](doc/tiefling-male.svg)![tiefling-female](doc/tiefling-female.svg)

### Gender

`avataria --gender male`

You can specify a gender by setting either `male` or `female`

## Module Usage

```javascript
const Avataria = require('avataria');

// specify options, none are required
const opts = {
  race: 'Human',
  gender: 'male',
};

// call the method
const avataria = new Avataria();
const avatar = avataria.generate(opts);
```

### Options

- __Race__: defaults to random, you can set the race to any available
- __Gender__: defaults to random, you can set the gender to either __male__ or __female__

## License

[MIT](https://github.com/opendnd/avataria/blob/master/LICENSE)
npm package: @opendnd/genetica
Description: This is a tool for using a simplified genetics system to generate inheritable traits for DnD characters.
Author: Drew Morris
Latest version: 0.6.1

# genetica
Genetica is a tool for using a simplified genetics system to generate inheritable traits for DnD characters.

[![NPM](https://nodei.co/npm/genetica.png?downloads=true&stars=true)](https://nodei.co/npm/genetica/)

[![Build Status](https://travis-ci.org/opendnd/genetica.svg?branch=master)](https://travis-ci.org/opendnd/genetica)

## Installation
You will need [node](https://nodejs.org/en/) and [npm](https://www.npmjs.com/) installed. Then run the command:

`npm install -g genetica`

## Generate DNA from CLI

```shell
genetica
```

Follow the prompts for Race and Gender (optional) and your DNA is outputted with information on traits.

## Module Usage
Require genetica into your file and create a new Genetica class. 

```javascript
const Genetica = require('genetica');

const genetica = new Genetica();

const opts = {
  gender: 'female',
  race: 'Dragonborn'
};

const DNA = genetica.generate(opts);
```

## Simplified DNA System
Each generated character has a set of DNA with chromosomes. These chromosomes go to applying traits.

Each chromosome has two pairs with dice rolls based on the size of the chromosome: either `d2`, `d4`, `d6`, `d8`, `d12`, `d20`, or `d100`. So for example, Chromosome 1 has a size of `d8` and the pair rolls for `5=8` which means the mother gave a roll of `5` and the father gave a roll of `8`.

__Rules__
- Dominant/Recessive Genetic Rules: A rule of `3` means if 3 is the highest rolled then the trait applies. For example: a chromosome pair of `1=3` would mean the rule applies as 3 is the highest roll, but for a pair of `8=3` it would not.
- Co-dominant Genetic Rules: `1=3` means that the roll for the mother must be 1 and the father must be 3 in that order. A `3=1` would not apply the rule. ___This rule is checked BEFORE the dominant/recessive rules___.

Inspiration: http://www.chromosomewalk.ch/en/list-of-chromosomes/

## Developing

To develop genetica,

```shell
git clone https://github.com/opendnd/genetica.git
cd genetica/
npm install
```

## Contributing

If you'd like to contribute, please fork the repository and use a feature
branch. Pull requests are welcome!

Genetica uses the [Airbnb](https://github.com/airbnb/javascript) javascript style.

## Licensing

[MIT](https://github.com/opendnd/genetica/blob/master/LICENSE)
npm package: @opendnd/nomina
Description: A tool for generating names for characters with a wide variety
Author: Drew Morris
Latest version: 0.4.4

# nomina

[![NPM](https://nodei.co/npm/nomina.png?downloads=true&stars=true)](https://nodei.co/npm/nomina/) 

[![Build Status](https://travis-ci.org/opendnd/nomina.svg?branch=master)](https://travis-ci.org/opendnd/nomina)

This is a tool for generating names for characters with a wide variety.

## Installation

You will need [node](https://nodejs.org/en/) and [npm](https://www.npmjs.com/) installed. Then do:

`npm install -g nomina`

## Generate a name

Once you have installed nomina you can generate a name by simply running the following: 

`nomina`

## Options

### Theme

`nomina --theme medieval`

To see the available name types you can do `nomina list`

### Gender

`nomina --type female`

You can specify a gender by setting either `male` or `female` (or for convenience `m` / `f`) or you can specify a city/town name by passing `dominia`.

## Module Usage

```javascript
const Nomina = require('nomina');
const nomina = new Nomina();

// specify options, none are required
const options = {
  theme: 'medieval',
  type: 'female',
};

// call the method
const result = nomina.generate(options);

// get all themes available
const themes = nomina.getThemes();
```

## Custom Configs
There are a couple of ways you can configure the themes that the tool uses:

### CLI Config
The CLI checks for `~/.dnd/nomina/defaults.js` before loading any other configuration. Simply add a file here while using the tool and you can customize the themes.

### Class Config
You can pass a "defaults" config directly to the class on initialization:

```javascript
const Nomina = require('nomina');
const defaults = {
  themes: {
    myCustomTheme: {
      male: [],
      female: [],
      dominia: [],
    },
    myOtherCustomTheme: {
      male: [],
      female: [],
      dominia: [],
    },
  },
};

const nomina = new Nomina({ defaults });
const themes = nomina.getThemes(); // ['myCustomTheme', 'myOtherCustomTheme']
```

## Developing

To develop nomina,

```shell
git clone https://github.com/opendnd/nomina.git
cd nomina/
npm install
```

## Contributing

If you'd like to contribute, please fork the repository and use a feature
branch. Pull requests are welcome!

Nomina use the [Airbnb](https://github.com/airbnb/javascript) javascript style.

## Licensing

[MIT](https://github.com/opendnd/nomina/blob/master/LICENSE)
npm package: @opendnd/personae
Description: This tool is used to generate a person either NPC or other Edit
Author: Drew Morris
Latest version: 0.10.8

# personae
This tool is used to generate a person either NPC or playable characters for D&D.

[![NPM](https://nodei.co/npm/personae.png?downloads=true&stars=true)](https://nodei.co/npm/personae/)

[![Build Status](https://travis-ci.org/opendnd/personae.svg?branch=master)](https://travis-ci.org/opendnd/personae)

## Installation
You will need [node](https://nodejs.org/en/) and [npm](https://www.npmjs.com/) installed. Then run the command:

`npm install -g personae`

## Generate a Person from CLI

```shell
personae
``` 

Follow the prompts, choosing: PC, NPC, culture, name, etc (all optional), and personae will generate a description of the person as well as abilities. You can save the person, or start over.

## Module Usage

Require personae into your file and create a new Personae class. 

```javascript
const Personae = require('personae');

const person = new Personae();

const options = {
  name: 'Dan',
  alignment: 'Chaotic Neutral',
  klass: 'Ranger',
  age: '300',
  race: 'Dwarf',
  theme: 'classical',
};

const brotherOpts = {
  name: 'Li',
  gender: 'male',
};

const dan = person.generate(options);

const parentsOfDan = person.generateParents(dan);
const brother = person.generateChild(brotherOpts, parentsOfDan.mother, parentsOfDan.father);
```

While configuring your character's options please note that in JavaScript 'class' is a special keyword, so personae uses 'klass'.

## Features

Personae can create a NPC or PC for Dungeons and Dragons, as well as abilities, children and parents for your character.

## Developing

To develop personae,

```shell
git clone https://github.com/opendnd/personae.git
cd personae/
npm install
```

## Contributing

If you'd like to contribute, please fork the repository and use a feature
branch. Pull requests are welcome!

Personae use the [Airbnb](https://github.com/airbnb/javascript) javascript style.

## Licensing

[MIT](https://github.com/opendnd/personae/blob/master/LICENSE)
npm package: @opendoc/openapi-reference-parser
Description: Get the dependencies of reference in openapi.
Author: Val.istar.Guo
Latest version: 1.3.9

# @opendoc/sdk

Get the dependencies of reference in openapi.

## Usage

```typescript
import { OpenapiReferenceParser } from "@opendoc/openapi-reference-parser";

const parser = new OpenapiReferenceParser({
  openapi: "3.0.0",
  info: {
    title: "Untitled",
    version: "1.0.0",
  },
  paths: {
    "/users/{id}": {
      put: {
        parameters: [{ $ref: "#/components/parameters/id" }],
        requestBody: {
          content: {
            "application/json": {
              schema: { $ref: "#/components/schemas/User" },
            },
          },
        },
        responses: {
          200: {
            description: "",
            content: {
              "application/json": {
                schema: {
                  $ref: "#/components/schemas/User",
                },
              },
            },
          },
        },
      },
    },
  },
  components: {
    parameters: {
      id: {
        name: "id",
        required: true,
        in: "path",
        schema: { type: "string" },
      },
    },

    schemas: {
      User: {
        type: "object",
        properties: {
          friends: {
            type: "array",
            items: { $ref: "#/components/schemas/User" },
          },
          address: {
            $ref: "#/components/schemas/Address",
          },
        },
      },
      Address: {
        type: "object",
        properties: {
          province: {
            type: "string",
          },
          street: {
            type: "string",
          },
        },
      },
    },
  },
});

const result = parser.parse();
```

The Result:

```json
{
  "paths": {
    "/users/{id}": {
      "put": {
        "dependencies": [
          "#/components/parameters/id",
          "#/components/schemas/User",
          "#/components/schemas/Address"
        ],
        "directDependencies": [
          "#/components/parameters/id",
          "#/components/schemas/User"
        ],
        "transitiveDependencies": ["#/components/schemas/Address"]
      }
    }
  },
  "components": {
    "parameters": {
      "id": {
        "dependencies": [],
        "directDependencies": [],
        "transitiveDependencies": []
      }
    },
    "schemas": {
      "User": {
        "dependencies": ["#/components/schemas/Address"],
        "directDependencies": ["#/components/schemas/Address"],
        "transitiveDependencies": []
      },
      "Address": {
        "dependencies": [],
        "directDependencies": [],
        "transitiveDependencies": []
      }
    }
  }
}
```
npm package: @opendoc/register
Description: ## Install
Author: Val-istar-Guo
Latest version: 1.1.0

# @opendoc/nestjs

## Install

```bash
npm install @opendoc/register
```

## Usage

```typescript
import { register } from "@opendoc/register";

// 准备好Swagger数据
const doc = {
  openapi: "3.0.0",
  info: {
    title: "Untitled",
    version: "1.0.0",
  },
  paths: {
    // ...
  },
  components: {
    // ...
  },
};

// 注册至Opendoc服务
register({
  server: "http://your_opendoc_host",

  application: {
    code: "your_application_code",
    title: "Your Application Title",
  },

  apiDocuments: [
    {
      type: "openapi",
      title: "Http",
      code: "http",
      order: 1,
      file: JSON.stringify(doc),
    },
  ],
});
```
npm package: @opendoc/sdk
Description: Transform Swagger 3.0 to the code
Author: Val.istar.Guo
Latest version: 1.3.6

# @opendoc/sdk

将 openapi@3/swagger@3/asyncapi@3 编译成 Typescript 代码。

## compile(compileOptions)

```typescript
import { compile, FileNamingStyle, Compiler } from "@opendoc/sdk";

const swagger = {
  openapi: "3.0.0",
  info: {
    title: "Untitled",
    version: "1.0.0",
  },
  paths: {
    // ...
  },
  components: {
    // ...
  },
};

compile({
  strict: false,
  outdir: "./api",
  fileNamingStyle: FileNamingStyle.snakeCase,
  moduleName: "test",
  compiler: Compiler.openapiCore,
  project: false,
  document: swagger,
});
```

### compileOptions

| option          | default                     | description                      |
| :-------------- | :-------------------------- | :------------------------------- |
| strict          | `false`                     | 是否清除 outdir 已存在的其他文件 |
| outdir          | `"./api"`                   | 输出编译结果的文件夹             |
| fileNamingStyle | `FileNamingStyle.snakeCase` | 文件名的明明风格                 |
| moduleName      | -                           | 模块名称                         |
| compiler        | -                           | 编译器，需要与文档的类型一致     |
| document        | -                           | 文档内容                         |
| project         | false                       | 是否将编译结果作为一个独立的项目 |

### FileNamingStyle

| enum                           | example       |
| :----------------------------- | :------------ |
| `FileNamingStyle.camelCase`    | `"twoWords"`  |
| `FileNamingStyle.capitalCase`  | `"Two Words"` |
| `FileNamingStyle.constantCase` | `"TWO_WORDS"` |
| `FileNamingStyle.dotCase`      | `"two.words"` |
| `FileNamingStyle.headerCase`   | `"Tow-Words"` |
| `FileNamingStyle.noCase`       | `"two words"` |
| `FileNamingStyle.paramCase`    | `"two-words"` |
| `FileNamingStyle.pascalCase`   | `"TwoWords"`  |
| `FileNamingStyle.pathCase`     | `"two/words"` |
| `FileNamingStyle.sentenceCase` | `"Two words"` |
| `FileNamingStyle.snakeCase`    | `"two_words"` |

### Compiler

| enum                    | description                                              |
| :---------------------- | :------------------------------------------------------- |
| `Compiler.openapiCore`  | openapi@3/swagger@3 编译器。输出通用的 Typescript 代码。 |
| `Compiler.openapiReact` | openapi@3/swagger@3 编译器。输出 React Hooks 代码        |
| `Compiler.asyncapiCore` | asyncapi@3 编译器。输出通用的 Typescript 代码。          |
npm package: @opendoc/uri-template
Description: URI template implementation (RFC 6570 compliant)
Author: Val.istar.Guo
Latest version: 1.5.4

# @opendoc/uri-template

## Usage

```typescript
import { UriTemplate } from "@opendoc/uri-template";

const uriTemplate = new UriTemplate("/api/users/{id}");

uriTemplate.extend({ id: 1 }); // api/users/1
```
npm package: @opendocsg/pdf2md
Description: A PDF to Markdown Converter
Author: Open Government Products, Government Technology Agency of Singapore
Latest version: 0.2.6

# pdf2md

JavaScript npm library to parse PDF files and convert them into Markdown

## Major Changes

See [Releases](https://github.com/opendocsg/pdf2md/releases)

## Usage

### Library

```js
const path = require('path');
const fs = require('fs')
const pdf2md = require('@opendocsg/pdf2md')

const pdfBuffer = fs.readFileSync(filePath)
pdf2md(pdfBuffer, callbacks)
  .then(text => {
    let outputFile = allOutputPaths[i] + '.md'
    console.log(`Writing to ${outputFile}...`)
    fs.writeFileSync(path.resolve(outputFile), text)
    console.log('Done.')
  })
  .catch(err => {
    console.error(err)
  })
```

### CLI tool

```
$ cd [project_folder]
$ npx @opendocsg/pdf2md --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive
```

If you are converting recursively on a large number of files you might encounter the error "Allocation failed - JavaScript heap out of memory”. Instead, run the command

```
$ node lib/pdf2md-cli.js --max-old-space-size=4096 --inputFolderPath=[your input folder path] --outputFolderPath=[your output folder path] --recursive
```

Options:
1. Input folder path (should exist)
2. Output folder path (should exist)
3. Recursive - convert all PDFs for folders within folders. Specify the tag if you require recursive, and omit if you don't

## Credits

[pdf-to-markdown](https://github.com/jzillmann/pdf-to-markdown) - original project by Johannes Zillmann  
[pdf.js](https://mozilla.github.io/pdf.js/) - Mozilla's PDF parsing & rendering platform which is used as a raw parser