{"id":21937607,"url":"https://github.com/cap32/skeeler","last_synced_at":"2026-04-06T08:02:02.023Z","repository":{"id":57362239,"uuid":"116375875","full_name":"Cap32/skeeler","owner":"Cap32","description":"🎩  Writing schema magically","archived":false,"fork":false,"pushed_at":"2018-02-04T13:46:53.000Z","size":197,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T12:33:12.626Z","etag":null,"topics":["autovivification","browser","javascript","json","keywords","magic","nodejs","schema","type","validation"],"latest_commit_sha":null,"homepage":"","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/Cap32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-05T11:00:24.000Z","updated_at":"2018-02-19T13:38:28.000Z","dependencies_parsed_at":"2022-09-13T21:00:44.023Z","dependency_job_id":null,"html_url":"https://github.com/Cap32/skeeler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap32%2Fskeeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap32%2Fskeeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap32%2Fskeeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cap32%2Fskeeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cap32","download_url":"https://codeload.github.com/Cap32/skeeler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244967858,"owners_count":20540024,"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":["autovivification","browser","javascript","json","keywords","magic","nodejs","schema","type","validation"],"created_at":"2024-11-29T01:20:43.647Z","updated_at":"2025-12-30T23:47:33.747Z","avatar_url":"https://github.com/Cap32.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skeeler\n\n[![Build Status](https://travis-ci.org/Cap32/skeeler.svg?branch=master)](https://travis-ci.org/Cap32/skeeler)\n[![Coverage Status](https://coveralls.io/repos/github/Cap32/skeeler/badge.svg?branch=master)](https://coveralls.io/github/Cap32/skeeler?branch=master)\n\nWriting schema magically\n\nThe name is somewhat of a poor choice, but it was available on [npm](https://www.npmjs.com/package/skeeler).\n\n## Simple Example\n\n```js\nimport Skeeler from 'skeeler';\nimport SkeelerJSONSchemaDraft6 from 'skeeler-json-schema-draft-6';\nimport SkeelerMongoose from 'skeeler-mongoose';\n\nconst types = Skeeler.use('json', new SkeelerJSONSchemaDraft6())\n  .use('mongoose', new SkeelerMongoose())\n  .getKeywords();\n\nconst mySkeeler = new Skeeler({\n  foo: types.string.required.unique,\n  bar: types.number.index.exclusiveMinimum(0),\n  baz: types.objectId.required,\n  qux: types.array(types.string),\n});\n\nconst jsonSchema = mySkeeler.export('json');\nconst mongooseSchema = mySkeeler.export('mongoose');\n\nexport { jsonSchema, mongooseSchema };\n```\n\n### Equals to JSON Schema v6\n\n```js\nexport const jsonSchema = {\n  properties: {\n    foo: {\n      type: 'string',\n    },\n    bar: {\n      type: 'number',\n      exclusiveMinimum: 0,\n    },\n    baz: {},\n    qux: {\n      type: 'array',\n      items: {\n        type: 'string',\n      },\n    },\n  },\n  required: ['foo', 'baz'],\n};\n```\n\n### Equals to Mongoose Schema\n\n```js\nexport const mongooseSchema = new Mongoose.Schema({\n  foo: {\n    type: String,\n    required: true,\n    unique: true,\n  },\n  bar: {\n    type: Number,\n    index: true,\n  },\n  baz: {\n    type: Mongoose.Types.ObjectId,\n    required: true,\n  },\n  qux: [\n    {\n      type: String,\n    },\n  ],\n});\n```\n\n## Complex Example\n\n```js\nimport Skeeler from 'skeeler';\nimport SkeelerJSONSchemaDraft6 from 'skeeler-json-schema-draft-6';\nimport SkeelerMongoose from 'skeeler-mongoose';\n\nconst types = Skeeler.use('json', new SkeelerJSONSchemaDraft6())\n  .use('mongoose', new SkeelerMongoose())\n  .getKeywords();\n\nconst mySkeeler = new Skeeler({\n  foo: types.string.required.unique,\n  bar: types.number.index,\n  baz: types.objectId.required,\n  qux: types.anyOf([\n    types.object({\n      quux: types.number.exclusiveMinimum(0),\n      corge: types.string,\n    }),\n    types.string.enum(['grault', 'garply']),\n    types.boolean,\n  ]),\n  waldo: types.anyOf([types.array(types.string), types.string]).default([]),\n});\n\nconst jsonSchema = mySkeeler.export('json');\n\nconst mongooseSchema = mySkeeler.export('mongoose', { timestamps: true });\nmongooseSchema.index({ foo: 'text', baz: 'text' });\n\nexport { jsonSchema, mongooseSchema };\n```\n\n## Related Projects\n\n* [skeeler-json-schema-draft-6](https://github.com/Cap32/skeeler-json-schema-draft-6)\n* [skeeler-mongoose](https://github.com/Cap32/skeeler-mongoose)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap32%2Fskeeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcap32%2Fskeeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcap32%2Fskeeler/lists"}