{"name":"json-schema-typed","description":"JSON Schema TypeScript definitions with complete inline documentation.","license":"BSD-2-Clause","version":"8.0.0","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.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-z9QqE9OwHFvV/FmNmric441msnbDpAzch/N5Db+vKpLag6gJMYFxzdtxlpdVAF/jQEZHjQaZR9z2pO0skvip4g==","shasum":"60092a3075a64582af8bf2d80a8433fea8f09393","tarball":"http://registry-npm.ywwl.com/json-schema-typed/download/json-schema-typed-8.0.0.tgz","fileCount":12,"unpackedSize":173700,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIjagACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoaIw/+NkbRDnpU/30fGH3RLQ/ZY3NYgi3SY6VKBTKDc95rIkJTLzJg\r\nPdEBHXjHmgIMcyWRl2vX353FyeeKuoW1Ba6aKQ7i+ZiBPaDDP8MIQ+Xw3mY/\r\nk/2BjKYYzUmFGTazDS8edQ4pyTOYTPCZT5gcjZ3L+CkIjxaqg+npi/AjGz9f\r\nvv3zlctqpsMtmP0CSnYJbb/YIPU/I6HMnTDZoiCoU+HjNztSnJxQGQ8yeA32\r\nX7XT5Kqbsc0ys/1+Wn8qp1JFQJ5jpEBBfdQt7goCaI20AqFyE3hd1OvqWGMp\r\nC52HMybmmMZI9Pzm2f8IIQtoc9KAI5vBnmL0j1NCDyY0k5VrGNzXowK8XeTE\r\nYpMNwtkZHqhw+i35Cnvoz7t3044dJiMGoe7WxcfljWlepu/rGUXoL1xxE9TA\r\nOm3tsVm5i939TSTenMCNoeOoIyk4T7ffSJfUhzPeu0WEkHtKe6u8A/igk4GJ\r\nUrkL9zVRbPKljhW8ElVJIxmBCzYv/vF43FLvCTrmUnsJ85tEZWupEwt5E3mw\r\nSJmtf7zM2oXtoaOC6nyQV3CFyH2Dx717hKicJBKTD9N7ZiWrD5nKxj2h+hXA\r\nqvBoXHpZCU3E1Vyt/xJdk6neBnVRSTY6uL9x+IhkKtfNiG7dYLXsrPH/o6dM\r\nZpfsMTOwxnn9ZKI/ks6TK/rWgBgWx5hACJw=\r\n=LMHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsTyFnUXiT9xy4i12zWKV0jvUZIGzt0jBTk0J2A85VdAiEAwpiyqCpfs/zAaDiIlTEtYW2BvFgBVa+0UgEB0uhV2I8="}],"size":38949,"noattachment":false,"key":"/json-schema-typed/-/json-schema-typed-8.0.0.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.0_1646409376182_0.3914138618195506"},"_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":1646409376306,"_cnpm_publish_time":1646409376306,"dist-tags":{"latest":"9.0.0"}}