# @zcong/mongoose-schema-parser

> simple mongoose schema parser

Latest version **0.5.0** (published 2020-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zcong/mongoose-schema-parser
pnpm add @zcong/mongoose-schema-parser
yarn add @zcong/mongoose-schema-parser
bun add @zcong/mongoose-schema-parser
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2020-06-17 |
| First published | 2019-09-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zcong1993 |
| Maintainers | zcong |

## Links

- npm: https://www.npmjs.com/package/@zcong/mongoose-schema-parser
- npm.io page: https://npm.io/package/@zcong/mongoose-schema-parser

## Recent versions

- 0.5.0 (latest) — 2020-06-17
- 0.4.1 — 2020-05-30
- 0.4.0 — 2020-05-30
- 0.3.1 — 2020-05-30
- 0.3.0 — 2020-05-29
- 0.2.0 — 2020-05-29
- 0.1.8 — 2019-09-09
- 0.1.7 — 2019-09-09
- 0.1.6 — 2019-09-09
- 0.1.5 — 2019-09-09
- 0.1.4 — 2019-09-06
- 0.1.3 — 2019-09-06
- 0.1.2 — 2019-09-06
- 0.1.1 — 2019-09-05

## README

# mongoose-schema-parser

[![NPM version](https://img.shields.io/npm/v/@zcong/mongoose-schema-parser.svg?style=flat)](https://npmjs.com/package/@zcong/mongoose-schema-parser) [![NPM downloads](https://img.shields.io/npm/dm/@zcong/mongoose-schema-parser.svg?style=flat)](https://npmjs.com/package/@zcong/mongoose-schema-parser) [![CircleCI](https://circleci.com/gh/zcong1993/mongoose-schema-parser/tree/master.svg?style=shield)](https://circleci.com/gh/zcong1993/mongoose-schema-parser/tree/master) [![codecov](https://codecov.io/gh/zcong1993/mongoose-schema-parser/branch/master/graph/badge.svg)](https://codecov.io/gh/zcong1993/mongoose-schema-parser)

> simple mongoose schema parser

## Install

```bash
$ yarn add @zcong/mongoose-schema-parser
```

## Usage

```ts
import { parseSchema } from '@zcong/mongoose-schema-parser'

const testSchema = new Schema({
  id: ObjectId,
  name: String,
  age: {
    type: Number
  }
})

console.log(parseSchema(testSchema))
// {
//   id: {
//     type: {
//       type: TypeEnum.ObjectId,
//       isArray: false
//     }
//   },
//   name: {
//     type: {
//       type: TypeEnum.String,
//       isArray: false
//     }
//   },
//   age: {
//     type: {
//       type: TypeEnum.Number,
//       isArray: false
//     },
//     details: {}
//   }
// }
```

## License

MIT &copy; zcong1993

---
_Source: https://npm.io/package/@zcong/mongoose-schema-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
