1.3.0 • Published 8 years ago

mdf v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

npm version

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

$ 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

$ npm install mdf
$ npm test
1.3.0

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.9

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago