{"id":26246031,"url":"https://github.com/zillow/manikin-model","last_synced_at":"2025-12-26T10:13:56.616Z","repository":{"id":48672999,"uuid":"168187530","full_name":"zillow/manikin-model","owner":"zillow","description":"A JS library for defining clear, reliable, flexible, and enforceable data models.","archived":false,"fork":false,"pushed_at":"2021-07-14T20:39:35.000Z","size":203,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-09T16:17:13.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zillow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-29T16:27:26.000Z","updated_at":"2021-07-14T20:39:38.000Z","dependencies_parsed_at":"2022-08-27T08:21:45.294Z","dependency_job_id":null,"html_url":"https://github.com/zillow/manikin-model","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fmanikin-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fmanikin-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fmanikin-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zillow%2Fmanikin-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zillow","download_url":"https://codeload.github.com/zillow/manikin-model/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243292854,"owners_count":20268126,"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":[],"created_at":"2025-03-13T13:17:15.924Z","updated_at":"2025-12-26T10:13:51.580Z","avatar_url":"https://github.com/zillow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/zillow/manikin-model.svg?branch=master)](https://travis-ci.com/zillow/manikin-model)\n[![NPM Version](https://img.shields.io/npm/v/manikin-model.svg)](https://www.npmjs.com/package/manikin-model)\n\n# Manikin Model\n\nManikin provides a basis for defining models/schema for JavaScript concepts.\n\n## Docs\n\n- [API](src/api.md)\n\n## Installation\n\n`npm install manikin-model --save`\n\n## Overview\n\nExample of a basic model:\n\n```javascript\nimport { createModel } from \"manikin-model\";\n\n/**\n * A model that represents a company.\n *\n * @class CompanyModel\n */\nconst CompanyModel = createModel(\"CompanyModel\", {\n  /**\n   * The name of the company.\n   *\n   * @type {String}\n   * @default ''\n   */\n  companyName: \"\",\n\n  /**\n   * The url for the company.\n   *\n   * @type {String}\n   * @default null\n   */\n  url: null\n});\n\nexport default CompanyModel;\n```\n\nCreating an instance of the model:\n\n```javascript\nimport CompanyModel from \"./path/to/CompanyModel\";\n\nlet microsoft = new CompanyModel({\n  companyName: \"Microsoft\"\n});\n\n// Get a value\nconsole.log(microsoft.get(\"companyName\")); // 'Microsoft'\n\n// Set a value and get it after it has been changed\nconsole.log(microsoft.get(\"url\")); // null\nmicrosoft = microsoft.set(\"url\", \"http://microsoft.com\");\nconsole.log(microsoft.get(\"url\")); // 'http://microsoft.com'\n\n// Get and set multiple properties at a time\nconsole.log(microsoft.getProperties(\"companyName\", \"url\")); // { companyName: 'Microsoft', url: 'http://microsoft.com'}\nmicrosoft = microsoft.setProperties({\n  companyName: \"Google\",\n  url: \"http://google.com\"\n});\nconsole.log(microsoft.getProperties(\"companyName\", \"url\")); // { companyName: 'Google', url: 'http://google.com'}\n```\n\n## Testing\n\nThis project uses Jest for testing. Relevant tests will be run on precommit, and all tests will be run on Jenkins once your changes are pushed.\n\n- Run tests relevant to your changes `npm test`\n- Run all test via `npm test -- --watchAll`.\n- Run all tests without watch by running `npm test -- --no-watch`.\n- Run tests for a specific file by running `npm test -- MyFile.js`.\n- Run tests based on the test name by running `npm test -- -t 'test pattern'`.\n- Run test with coverage by running `npm test -- --coverage`.\n\nBecause this is a utility that could be used in many ways, a high level of testing coverage will be maintained on this project.\n\n## Linting\n\nThis project uses eslint and prettier to format JavaScript.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzillow%2Fmanikin-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzillow%2Fmanikin-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzillow%2Fmanikin-model/lists"}