{"name":"json-schema-typed","description":"JSON Schema TypeScript definitions with complete inline documentation.","license":"BSD-2-Clause","version":"8.0.1","homepage":"https://github.com/jrylan/json-schema-typed/tree/main/dist/node","repository":{"type":"git","url":"git+https://github.com/jrylan/json-schema-typed.git"},"author":{"name":"Jeremy Rylan","url":"https://github.com/jrylan"},"main":"./draft-2020-12.js","type":"module","exports":{".":"./draft-2020-12.js","./draft-07":"./draft-07.js","./draft-2019-09":"./draft-2019-09.js","./draft-2020-12":"./draft-2020-12.js"},"keywords":["jsonschema","typescript","types","definitions","json","schema"],"bugs":{"url":"https://github.com/jrylan/json-schema-typed/issues"},"_id":"json-schema-typed@8.0.1","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-XQmWYj2Sm4kn4WeTYvmpKEbyPsL7nBsb647c7pMe6l02/yx2+Jfc4dT6UZkEXnIUb5LhD55r2HPsJ1milQ4rDg==","shasum":"826ee39e3b6cef536f85412ff048d3ff6f19dfa0","tarball":"http://registry-npm.ywwl.com/json-schema-typed/download/json-schema-typed-8.0.1.tgz","fileCount":12,"unpackedSize":173699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIj1AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWTQ//RGxOpVMH6q9IR/PEyMtpRz5zdLWhX9UcwEv8hkGWbf5b+y7h\r\nheVfu1B4p0xmRz9GfeUeuc/1WlXYeJw6Pkk7YY2Z/yfhJLmWr+kp6wOIj+o8\r\nA8VHG58KpSRu5mthKIISv02Rlyg/JYgO0aNmMHDWqmAs1x/6Ogjz0BeqyFMu\r\nH2XYAMALNm9wads4tClYRYeWbMNMThJrZjq//d1Ck2EbKS5elkvVxTxhckJ7\r\n8tPXlviuJ6mGeFalej+X5EnoLUk+1ra3maNPaT1TosylCPeeXW4kk1ENzZVz\r\nORMqwvIRXb1Pn8dYuwQnQYOPW7PmtsusSM3kOVwxW+TgWptcxE54zcUN+Uql\r\nVokNwjFQPVW6O/4DLuPrPqNCS51MxlPuegMkgWVH5CTVr1LvooRIR/GkXqCG\r\nClyYdHkjfpwmW68sTgqILoL3von3IBYUX0DMQhwlsra66uyV8dkIOvMs/rw9\r\n6lyXBtgjBSZdbLjIzK2ps3NBqRF/6scmnlW9aBVNV6USLekEFQ6uQi7JYro8\r\nn+S7cyLrDhsyBHD1NYmcs9h6H0ENGHEV3N7ITizEI1QkdFZbbYZph3uBtO1P\r\nuhBsDnkkTAyv5wr27q21JPhdtd9+Mdo30ZUOscNeo2IRzk7T2YUK0MOiZQeD\r\naD61EGlZp98Yej7eVj+UZd+jsYLHnFDwQUU=\r\n=OuPO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2dGTCXap/IgkXlcn8fpkJtCoybyxYZT2BmfIGO8hDWwIhAIr/25pvxmpVEyeJH4PwmihP+AN+/sWvvtBJW3t5njmq"}],"size":38947,"noattachment":false,"key":"/json-schema-typed/-/json-schema-typed-8.0.1.tgz"},"_npmUser":{"name":"jrylan","email":"jeremyrylan@me.com"},"directories":{},"maintainers":[{"name":"jrylan","email":"jeremyrylan@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-schema-typed_8.0.1_1646411072028_0.5902990912754889"},"_hasShrinkwrap":false,"readme":"[![npm](https://img.shields.io/npm/v/json-schema-typed.svg?style=flat-square)](https://npmjs.org/package/json-schema-typed)\n[![downloads-per-month](https://img.shields.io/npm/dm/json-schema-typed.svg?style=flat-square&label=npm%20downloads)](https://npmjs.org/package/json-schema-typed)\n[![License](https://img.shields.io/badge/license-BSD--2--Clause-blue.svg?style=flat-square)][license]\n\n# JSON Schema Typed\n\nJSON Schema TypeScript definitions with complete inline documentation.\n\n**NOTE:** This library only supports defining schemas. You will need a separate\nlibrary for data validation.\n\nThere are 3 JSON Schema drafts included in this package:\n\n- `draft-07`\n- `draft-2019-09`\n- `draft-2020-12`\n\n## Install\n\n```sh\nnpm install json-schema-typed\n```\n\n## Usage\n\n1. Chose which draft you'd like to import.\n\n- The main package export points to the latest supported stable draft, currently\n  `draft-2020-12`. Future releases that point the main package export to a new\n  draft will always incur a bump to the major semantic version.\n\n  ```ts\n  import { type JSONSchema } from \"json-schema-typed\";\n  ```\n\n- Or you can specify the exact draft you need.\n  ```ts\n  import { type JSONSchema } from \"json-schema-typed/draft-2020-12\";\n  ```\n\n2. Define a schema\n\n   ```ts\n   import { Format, type JSONSchema } from \"json-schema-typed\";\n\n   const schema: JSONSchema = {\n     properties: {\n       email: {\n         format: Format.Email,\n         type: \"string\",\n       },\n     },\n     type: \"object\",\n   };\n\n   // The JSONSchema namespace also provides type-specific narrowed interfaces\n   const stringSchema: JSONSchema.String = {\n     // Only { type: \"string\" } and common keywords are allowed\n     maxLength: 100,\n     type: \"string\",\n   };\n   ```\n\n## Upgrading\n\nVersion `8.0.0` has breaking changes from the previous release.\n\n- Now a\n  [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\n- Many exports were renamed. The table below reflects the new export names.\n  These are considered final and unlikely to change in future releases.\n- The `JSONSchema` type was changed from an `interface` to a `type` which is a\n  mixed union that allows `boolean` values in order to properly align with the\n  JSON Schema spec. If you were previously extending the `JSONSchema` interface,\n  you can access the `interface` directly with `JSONSchema.Interface`.\n- The previous main package export pointed to Draft 7. Import it directly if you\n  need to continue using it:\n  ```ts\n  import { type JSONSchema } from \"json-schema-typed/draft-07\";\n  ```\n\n## Exports supported in each draft module\n\n| Name              | Type            | Purpose                                                            |\n| ----------------- | --------------- | ------------------------------------------------------------------ |\n| `$schema`         | `string`        | Draft meta schema URL that can be used with the `$schema` keyword. |\n| `ContentEncoding` | Enum object     | String content encoding strategies.                                |\n| `draft`           | `string`        | Draft version.                                                     |\n| `Format`          | Enum object     | String formats.                                                    |\n| `JSONSchema`      | TypeScript Type | Used to define a JSON Schema.                                      |\n| `keywords`        | `string[]`      | All the keywords for the imported draft.                           |\n| `TypeName`        | Enum object     | Simple type names for the `type` keyword.                          |\n\n## Versioning\n\nThis library follows [semantic versioning](https://semver.org).\n\n---\n\n## Maintainers\n\n- [Jeremy Rylan](https://github.com/jrylan)\n\n## License\n\n[BSD-2-Clause][license]\n\n[license]: https://github.com/jrylan/json-schema-typed/blob/main/dist/node/LICENSE.md\n","publish_time":1646411072121,"_cnpm_publish_time":1646411072121,"dist-tags":{"latest":"9.0.0"}}