# mdf

> A format for defining models through external schemas

Latest version **1.3.0** (published 2016-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install mdf
pnpm add mdf
yarn add mdf
bun add mdf
```

## 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.3.0 |
| Published | 2016-02-01 |
| First published | 2015-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alan Doherty |
| Maintainers | alandoherty |

## Links

- npm: https://www.npmjs.com/package/mdf
- Repository: https://github.com/alandoherty/mdf
- Homepage: https://github.com/alandoherty/mdf#readme
- Issues: https://github.com/alandoherty/mdf/issues
- npm.io page: https://npm.io/package/mdf

## Recent versions

- 1.3.0 (latest) — 2016-02-01
- 1.2.9 — 2016-02-01
- 1.2.8 — 2016-02-01
- 1.2.7 — 2016-02-01
- 1.2.6 — 2016-02-01
- 1.2.5 — 2016-02-01
- 1.2.4 — 2016-01-26
- 1.2.3 — 2016-01-19
- 1.2.2 — 2016-01-01
- 1.2.1 — 2015-12-31
- 1.2.0 — 2015-12-31
- 1.1.9 — 2015-12-31
- 1.1.4 — 2015-12-20
- 1.1.3 — 2015-12-20
- 1.1.2 — 2015-12-20
- … 3 more at https://npm.io/package/mdf/versions

## README

[![npm version](https://badge.fury.io/js/mdf.svg)](https://badge.fury.io/js/mdf)

A format for defining models through external schemas, allowing you to better interact and publish information, maintaining important characteristics such as visibility to the end user.

# Installing

```bash
$ npm install mdf
```

# Example

app.js
```
var mdf = require("../src/index");

mdf.loadFile("test.mdl", function(err) {
    if (err) {
        console.error("error parsing file");
        console.error(mdf.getErrors());
    } else {
        console.log(mdf.getModels());
        console.log(mdf.getEnums());
        console.log(mdf.getTypeDefs());
    }
});
```

test.mdl
```
import "hello.mdl";

model User : "tbl_user" {
    public string firstName = "";
    string lastName = "";
    Email email;
    bool emailVerified = false;
    bool notifications;
    bool blocked;
    bool isPrivate;
    Password password;
    ref<Group> group;
    array<string(48)> avatarUrls;
    State state;
}
```

hello.mdl
```
enum State {
    Potato,
    Mesh,
    Hole
}

typedef Email string(64)
typedef Password string(64)
```

# Testing

```bash
$ npm install mdf
$ npm test
```

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