{"_id":"tschema","_rev":"10-2f48d8bcb4a245f0af631e17abaea87f","name":"tschema","dist-tags":{"latest":"3.2.0"},"versions":{"1.0.0":{"name":"tschema","version":"1.0.0","author":{"name":"Hyojun Kim"},"license":"MIT","_id":"tschema@1.0.0","maintainers":[{"name":"vista","email":"retail3210@gmail.com"}],"homepage":"https://github.com/therne/tschema#readme","bugs":{"url":"https://github.com/therne/tschema/issues"},"dist":{"shasum":"dcbc5b04db24da14be6eefc7d83d4c239105cb9c","tarball":"https://registry.npmjs.org/tschema/-/tschema-1.0.0.tgz","integrity":"sha512-9K4abFUuMN1BThNi0wANjuwO7U8lmN5bteLTkiGmYDn8SX1u83X1qv+e81wyT2GnCFI4hJaksoqR8sKzmVhW1w==","signatures":[{"sig":"MEQCIGSGdbpfXdYgU3EDDQlp2Y+khRyVg0Sn5BwnSHfBX5eCAiAvQb36LaWCeS3uDTYnY410ZTk9lQHpYGLiu+hVEVaN8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"b854775f8f9d5d0f4bd25aaaeef1451c0f931d19","scripts":{"test":"mocha","test-coverage":"nyc mocha","report-coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"vista","email":"retail3210@gmail.com"},"repository":{"url":"git+https://github.com/therne/tschema.git","type":"git"},"_npmVersion":"5.4.2","description":"Simple and fastest static type checker for Node.js.","directories":{},"_nodeVersion":"8.5.0","devDependencies":{"nyc":"^11.3.0","mocha":"^4.0.1","coveralls":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tschema-1.0.0.tgz_1510432809272_0.5719002243131399","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"tschema","version":"1.1.0","author":{"name":"Hyojun Kim"},"license":"MIT","_id":"tschema@1.1.0","maintainers":[{"name":"vista","email":"retail3210@gmail.com"}],"homepage":"https://github.com/therne/tschema#readme","bugs":{"url":"https://github.com/therne/tschema/issues"},"dist":{"shasum":"c96a358eebf857dd74d23f44eb6a0eb6a85e52fc","tarball":"https://registry.npmjs.org/tschema/-/tschema-1.1.0.tgz","integrity":"sha512-g/2eczIkOBg7oLWi2PDHmKdNim03GPFcabqzx0x1nMs/+iKo0LmGOIhR+qfi4XtKcMhjYtg/23s2zmbngbhtbQ==","signatures":[{"sig":"MEQCIB3iWQcdXGgdkmZTE12Z8CV0Dn+SACGilNgNN3zxMl5wAiAKeEtCTbhv+n3d5vUm4jCI4W1aog9QGeUR/Mt31Qr6FQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"3b54cab5a74086e5e928fe0cd2e7b326b5964c07","scripts":{"test":"mocha","test-coverage":"nyc mocha","report-coverage":"nyc report --reporter=text-lcov | coveralls"},"_npmUser":{"name":"vista","email":"retail3210@gmail.com"},"repository":{"url":"git+https://github.com/therne/tschema.git","type":"git"},"_npmVersion":"5.4.2","description":"Simple and fastest static type checker for Node.js.","directories":{},"_nodeVersion":"8.5.0","devDependencies":{"nyc":"^11.3.0","mocha":"^4.0.1","coveralls":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/tschema-1.1.0.tgz_1510460132860_0.16100344504229724","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"tschema","version":"2.0.0","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"tschema@2.0.0","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/tschema#readme","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"dist":{"shasum":"5debe5c9928d88c367c315f2470c336ce38bbc19","tarball":"https://registry.npmjs.org/tschema/-/tschema-2.0.0.tgz","fileCount":5,"integrity":"sha512-CN1XiDRcYu88uPZKaghjniFkBzdQ8XQLVF2wt4hSc/nXaisMqAxfNcdZT6bfnm3fIRSu7aTn8+bTcsbgHQpMMQ==","signatures":[{"sig":"MEUCIBQdr0YazeyP3gbXRVFPILNKbxwGyyPHvSWenOJR9zyUAiEA66aqtO5tE/ZSzvILC7iYpk0yYVbrZ56TaeRT+RgxYHU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11372},"type":"module","types":"index.d.ts","module":"index.mjs","engines":{"node":">=14"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"gitHead":"1efa30fe94dd098076f08a947144fe0643a75e1a","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/tschema.git","type":"git"},"_npmVersion":"10.2.3","description":"A tiny (359b) utility to build JSON schema types.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tschema_2.0.0_1722923585066_0.1885923549475239","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"tschema","version":"2.0.1","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"tschema@2.0.1","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/tschema#readme","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"dist":{"shasum":"196ee6f38e6612523d212c5970e097e7e94ad483","tarball":"https://registry.npmjs.org/tschema/-/tschema-2.0.1.tgz","fileCount":5,"integrity":"sha512-YMkU9RKaMfLGd1xtdcYHVG3bASpkO0zsi9798KR47YnetLHR5iTy9is4WzPXPShWJxKGUWdXD6HxznDhw62WoA==","signatures":[{"sig":"MEUCIQDsjCu+6etaJRNeDyrMrZEtsH+1TqP0WSWj9INUHcNPnwIgShH2GP/JyW8jTXfv0IAhtxmd7ZNNqE7DaMBtPeBRGk4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11867},"type":"module","types":"index.d.ts","module":"index.mjs","engines":{"node":">=14"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"gitHead":"08bae7577d64692c0c235b08543ff26a5ec03945","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/tschema.git","type":"git"},"_npmVersion":"10.2.3","description":"A tiny (359b) utility to build JSON schema types.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tschema_2.0.1_1722969698521_0.8359035679829991","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"tschema","version":"2.1.0","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"tschema@2.1.0","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/tschema#readme","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"dist":{"shasum":"01bc5dade35f478397e4e093ef1d5a1b9a411435","tarball":"https://registry.npmjs.org/tschema/-/tschema-2.1.0.tgz","fileCount":5,"integrity":"sha512-p7SGez775g/XeJW5mhkccr0ravUV9wyUkFFEq7LS6+UiFbfLMZNHDAQ6obj/7FCPtDtuRkavcY1zBhWw0nwouA==","signatures":[{"sig":"MEUCIDIYBndcvt+C2E+/rjaJuKtPE/sojillZNXRvQaY24DxAiEA2JU01vvxaDYlKRLjW4BcyTy9K/ueZonuFkoyBUPX/CU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tschema@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12715},"type":"module","types":"index.d.ts","module":"index.mjs","engines":{"node":">=14"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"gitHead":"a6c66de47837903986d697cef2723d460220c0a6","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/tschema.git","type":"git"},"_npmVersion":"10.8.1","description":"A tiny (408b) utility to build JSON schema types.","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tschema_2.1.0_1722984935035_0.2631269238279006","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"tschema","version":"3.0.0","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"tschema@3.0.0","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/tschema#readme","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"dist":{"shasum":"62349da54eec899af5e886ddc06eb1b6cc5cee63","tarball":"https://registry.npmjs.org/tschema/-/tschema-3.0.0.tgz","fileCount":5,"integrity":"sha512-qiQUyPi89pJAqSR7oR/CWlttFipJJ61f9JJ0rd1yBiCqHlwpQngojidLgo//RcsbEQ8GklYcp7OW//ucwsvoVA==","signatures":[{"sig":"MEUCIQDP/Go+oLK+ZX3UhlVOL91nmnLmdcBMujm2nk84el62RwIgQBbRMsuhbiJMgNa+f8uz6Zjj3IYR0aj27+Wn1ClLuMg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tschema@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12965},"type":"module","types":"index.d.ts","module":"index.mjs","engines":{"node":">=14"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"gitHead":"184f07152b1ef63002404fbab0ebee61f7b0673d","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/tschema.git","type":"git"},"_npmVersion":"10.8.1","description":"A tiny (444b) utility to build JSON schema types.","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tschema_3.0.0_1723050466404_0.7676249307809515","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"tschema","version":"3.1.0","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"author":{"url":"https://lukeed.com","name":"Luke Edwards","email":"luke.edwards05@gmail.com"},"license":"MIT","_id":"tschema@3.1.0","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"homepage":"https://github.com/lukeed/tschema#readme","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"dist":{"shasum":"6e3b04fb4270251869405663f6d601a74f87276f","tarball":"https://registry.npmjs.org/tschema/-/tschema-3.1.0.tgz","fileCount":5,"integrity":"sha512-Q/+uKRKztF9e1vOUYo3sASLhfh5uPGp6su3LQjrZKqp520AclA+sIjt1+l+XgzQTjPpi90TEWdnC2abdNGRgAA==","signatures":[{"sig":"MEUCIQC+MlQ30DTEv1+qx1RJqJaTCq3sUdxW/ooLK4zXJ5uk0wIgCJY7Pop00w0KohRdDEGUBPrn5W2cmfH/0CXFHMwDO+M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13535},"type":"module","types":"index.d.ts","module":"index.mjs","engines":{"node":">=14"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"gitHead":"5bcb4efbbbae4f5caf77343f5eb48c4bb80e259a","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"repository":{"url":"git+https://github.com/lukeed/tschema.git","type":"git"},"_npmVersion":"10.2.3","description":"A tiny (490b) utility to build JSON schema types.","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tschema_3.1.0_1723621556638_0.8718311110366497","host":"s3://npm-registry-packages"}},"3.2.0":{"name":"tschema","version":"3.2.0","repository":{"type":"git","url":"git+https://github.com/lukeed/tschema.git"},"description":"A tiny (500b) utility to build JSON schema types.","module":"index.mjs","types":"index.d.ts","type":"module","license":"MIT","exports":{".":{"import":{"types":"./index.d.ts","default":"./index.mjs"}},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=14"},"keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"_id":"tschema@3.2.0","gitHead":"e40703ea955932be6132f0f17a92bfb2f3afcb0d","bugs":{"url":"https://github.com/lukeed/tschema/issues"},"homepage":"https://github.com/lukeed/tschema#readme","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-WC0IUxN7vo7lFH4FoscD/A8rtE4mpYPNfEVUfjDdZ5ML6d2H4WcBY62rwxxLoN+B/2B4Ffi+FLkSFgdOhG8goA==","shasum":"86378f3a2988fa15b49b11b1c93866192b2f87ea","tarball":"https://registry.npmjs.org/tschema/-/tschema-3.2.0.tgz","fileCount":5,"unpackedSize":14114,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tschema@3.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSqpww95gWZ7INsZjbYlEehW9iBpxBGt9EA0cJZ1FLcAIgKWE+9xdjOarQpyboq/aum7lvAi1cil5dwWOjHISwMV8="}]},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tschema_3.2.0_1728731572963_0.3364879668994951"},"_hasShrinkwrap":false}},"time":{"created":"2017-11-11T20:40:09.366Z","modified":"2024-10-12T11:12:53.612Z","1.0.0":"2017-11-11T20:40:09.366Z","1.1.0":"2017-11-12T04:15:32.959Z","2.0.0":"2024-08-06T05:53:05.235Z","2.0.1":"2024-08-06T18:41:38.669Z","2.1.0":"2024-08-06T22:55:35.241Z","3.0.0":"2024-08-07T17:07:46.569Z","3.1.0":"2024-08-14T07:45:56.861Z","3.2.0":"2024-10-12T11:12:53.204Z"},"bugs":{"url":"https://github.com/lukeed/tschema/issues"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"license":"MIT","homepage":"https://github.com/lukeed/tschema#readme","keywords":["infer json schema","json schema builder","object schema","typed schema","typecheck","validate"],"repository":{"type":"git","url":"git+https://github.com/lukeed/tschema.git"},"description":"A tiny (500b) utility to build JSON schema types.","maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"readme":"# tschema [![CI](https://github.com/lukeed/tschema/workflows/CI/badge.svg)](https://github.com/lukeed/tschema/actions?query=workflow%3ACI) [![licenses](https://licenses.dev/b/npm/tschema)](https://licenses.dev/npm/tschema)\n\n> A tiny (500b) utility to build [JSON schema](https://json-schema.org/understanding-json-schema/reference) types.\n\n## Install\n\nThis package is compatible with all JavaScript runtimes and is available on multiple registries:\n\n- **npm** &mdash; available as [`tschema`](https://www.npmjs.com/package/tschema)\n- **JSR** &mdash; available as [`@lukeed/tschema`](https://jsr.io/@lukeed/tschema)\n\n## Usage\n\n```ts\nimport * as t from 'tschema';\n\n// Define JSON object schema\nlet User = t.object({\n  uid: t.integer(),\n  name: t.string({\n    description: 'full name',\n    examples: ['Alex Johnson'],\n  }),\n  isActive: t.boolean(),\n  avatar: t.optional(\n    t.string({ format: 'uri' }),\n  ),\n  achievements: t.tuple([\n    t.number({ minimum: 0 }), // points\n    t.enum(['novice', 'pro', 'expert', 'master']),\n  ]),\n  interests: t.array(\n    t.string({\n      minLength: 4,\n      maxLength: 36,\n    }),\n  ),\n  last_updated: t.integer({\n    minimum: 0,\n    examples: [1722642982],\n    description: 'unix seconds',\n  }),\n}, {\n  description: 'a User record',\n});\n\n// Infer its TypeScript definition:\n// NOTE: names do not have to match~!\ntype User = t.Infer<typeof User>;\n//-> {\n//->   uid: number;\n//->   name: string;\n//->   isActive: boolean;\n//->   avatar?: string | undefined;\n//->   achievements: [number, \"novice\" | \"pro\" | \"expert\" | \"master\"];\n//->   interests: string[];\n//->   last_updated: number;\n//-> }\n\nconsole.log(User);\n//-> {\n//->   type: \"object\",\n//->   description: \"a User record\",\n//->   additionalProperties: false,\n//->   properties: {\n//->     uid: {\n//->       type: \"integer\"\n//->     },\n//->     name: {\n//->       type: \"string\",\n//->       description: \"full name\",\n//->       examples: [\"Alex Johnson\"]\n//->     },\n//->     isActive: {\n//->       type: \"boolean\"\n//->     },\n//->     avatar: {\n//->       type: \"string\",\n//->       format: \"uri\"\n//->     },\n//->     achievements: {\n//->       type: \"array\",\n//->       prefixItems: [{\n//->         type: \"number\",\n//->         minimum: 0\n//->       }, {\n//->         enum: [\"novice\", \"pro\", \"expert\", \"master\"]\n//->       }],\n//->       minItems: 2,\n//->       maxItems: 2\n//->     },\n//->     interests: {\n//->       type: \"array\",\n//->       items: {\n//->         type: \"string\",\n//->         minLength: 4,\n//->         maxLength: 36\n//->       }\n//->     },\n//->     last_updated: {\n//->       type: \"integer\",\n//->       minimum: 0,\n//->       examples: [1722642982],\n//->       description: \"unix seconds\"\n//->     }\n//->   },\n//->   required: [\n//->     \"uid\",\n//->     \"name\",\n//->     \"isActive\",\n//->     \"achievements\",\n//->     \"interests\",\n//->     \"last_updated\"\n//->   ]\n//-> }\n```\n\n## API\n\nPlease refer to the [generated API documentation](https://jsr.io/@lukeed/tschema/doc), as it's\nalways kept up-to-date.\n\n> **Note:** The API is the same across all JavaScript runtimes, regardless of [installation](#install) source. Only the package's name changes.\n\n## Benchmarks\n\n> Run on Deno 1.45.5 `(release, aarch64-apple-darwin)` with v8 `12.7.224.13`\n\n```\nfile: tschema/scripts/bench.ts\nruntime: deno 1.45.5 (aarch64-apple-darwin)\n\n# Builders\n  tschema              5,328,603.3 iter/sec     187.67 ns/iter\n  sinclair/typebox       130,480.2 iter/sec       7.66 µs/iter\n  zod-to-json-schema      46,928.5 iter/sec      21.31 µs/iter\n\n# Summary\n  tschema\n    40.84x faster than sinclair/typebox\n   113.55x faster than zod-to-json-schema\n```\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","readmeFilename":"readme.md"}