{"id":18726825,"url":"https://github.com/voltraco/dml","last_synced_at":"2025-04-12T16:31:56.457Z","repository":{"id":65460401,"uuid":"50886506","full_name":"voltraco/dml","owner":"voltraco","description":"A data modeling language (for node and the browser)","archived":false,"fork":false,"pushed_at":"2017-12-09T15:08:59.000Z","size":68,"stargazers_count":62,"open_issues_count":4,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T04:18:24.957Z","etag":null,"topics":["data-model","data-validation","modeling"],"latest_commit_sha":null,"homepage":"http://dml.sh","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voltraco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-02T01:58:25.000Z","updated_at":"2023-04-12T07:23:58.000Z","dependencies_parsed_at":"2023-01-24T14:45:20.870Z","dependency_job_id":null,"html_url":"https://github.com/voltraco/dml","commit_stats":null,"previous_names":["voltraco/node-dml","voltraco/node-models"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltraco%2Fdml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltraco%2Fdml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltraco%2Fdml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voltraco%2Fdml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voltraco","download_url":"https://codeload.github.com/voltraco/dml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248596574,"owners_count":21130723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-model","data-validation","modeling"],"created_at":"2024-11-07T14:15:37.878Z","updated_at":"2025-04-12T16:31:56.162Z","avatar_url":"https://github.com/voltraco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYNOPSIS\nA data modeling language reference implementation. See [dml.sh](http://dml.sh)\n\n# BUILD\n[![Build Status](https://travis-ci.org/voltraco/dml.svg)](https://travis-ci.org/voltraco/dml)\n\n# USAGE\n\n### sample.model\nDefine a model using the data modeling language syntax\n\n```js\n// An example data model\n\nDate created\nNumber id\n\nString name\n  require // this is a comment\n  gt 2 \"Must be greater than 2 characters\"\n  lte 256 \"Must be less than or equal to 256 characters\"\n\nString bio \"A bio must be a string\"\n  lte 140 \"A bio must fit into a tweet\"\n\nBoolean accountType\n```\n\n### index.js\nCompiling a model returns a function that will validate data.\n\n```js\nconst Models = require('node-dml')\n\nlet model = Models.compile(fs.readFileSync('sample.model', 'utf8'))\n\nlet result = model({\n  id: 1337,\n  created: new Date(),\n  name: 'Glen Danzig',\n  accountType: 'awesome'\n})\n```\n\n### output\n\nThe result will be an object that contains the final data, as well as a\n`length` property which indicates how many rules were violated, and a rules\nproperty containing information about the rules that were violated.\n\n```js\n{\n  data: {\n    id: 1337,\n    created: '2016-10-02T13:56:44.931Z',\n    name: 'Glen Danzig',\n    accountType: 'awesome'\n  },\n  length: 1,\n  rules: {\n    accountType: [{\n      validator: 'type',\n      message: 'Expected type [Boolean] but got type [String]'\n    }]\n  }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoltraco%2Fdml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoltraco%2Fdml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoltraco%2Fdml/lists"}