# parse-interface

> Parse interface to json

Latest version **1.1.0** (published 2021-01-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install parse-interface
pnpm add parse-interface
yarn add parse-interface
bun add parse-interface
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-01-11 |
| First published | 2020-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Tom Manger |
| Maintainers | tomanger |
| Keywords | interface, parse, parse-interface, parseInterface, interfaceToJson, typescriptToJson, interface-json, json, objectFromInterface |

## Links

- npm: https://www.npmjs.com/package/parse-interface
- Repository: https://github.com/tommanger/parse-interface
- Homepage: https://parse-interface.herokuapp.com
- Issues: https://github.com/tommanger/parse-interface/issues
- npm.io page: https://npm.io/package/parse-interface

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.20

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-01-11
- 1.0.14 — 2021-01-08
- 1.0.13 — 2021-01-08
- 1.0.12 — 2021-01-07
- 1.0.11 — 2021-01-07
- 1.0.10 — 2021-01-07
- 1.0.9 — 2021-01-03
- 1.0.8 — 2021-01-02
- 1.0.7 — 2021-01-01
- 1.0.6 — 2021-01-01
- 1.0.5 — 2021-01-01
- 1.0.4 — 2021-01-01
- 1.0.3 — 2020-12-29
- 1.0.2 — 2020-12-29
- 1.0.1 — 2020-12-28
- … 1 more at https://npm.io/package/parse-interface/versions

## README

# parse-interface
 [Visit our demo site](https://parse-interface.herokuapp.com/) 

```javascript
import {parseInterface} from "parse-interface";

const interfaceToParse: string = `
            export default interface IOption {
				name: string;
				isActive: boolean;
			}
		
            export default interface ITest {
                name: string;
                date: number;
                age: number | string;
                color: "red" | "blue",
                details: {
                    address: string | number;
                    extra: {
                        names: string[];
                        data: {
                            colors: string[];
                        }[];
                    };
                },
                dates: number[];
                children: {
                    name: string;
                }[];
                options: IOption[];
            }`
const parseResult: any = parseInterface(interfaceToParse);
console.log(parseResult);

/* output: [
  {
    "obj": {
      "name": "",
      "isActive": false
    },
    "name": "IOption",
    "unknown": []
  },
  {
    "obj": {
      "name": "",
      "date": 0,
      "age": 0,
      "color": "red",
      "details": {
        "address": "",
        "extra": {
          "names": [
            ""
          ],
          "data": [
            {
              "colors": [
                ""
              ]
            }
          ]
        }
      },
      "dates": [
        0
      ],
      "children": [
        {
          "name": ""
        }
      ],
      "options": [
        {
          "name": "",
          "isActive": false
        }
      ]
    },
    "name": "ITest",
    "unknown": []
  }
] */
```

---
_Source: https://npm.io/package/parse-interface · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
