{"_id":"@aokiapp/tlv","_rev":"7-a08d863ae8e8c6f9a64c93e3ddf43042","name":"@aokiapp/tlv","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"name":"@aokiapp/tlv","version":"0.1.0","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.1.0","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"57f11f2489d21f92bf002992172654e2d9bf94d7","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.1.0.tgz","fileCount":26,"integrity":"sha512-puHW6umf6olxirnRqons2jhcyG6jvP9uqm2PJliEqwUtnsqepGqwhwdIXJssN8qMP7HxZzmGyDhcGYxdQ5sAkg==","signatures":[{"sig":"MEQCIHurX5cHoMdjh8qvgHDlT8WVnCyVmVVSgyDcG6RUCVwzAiAI3IXS8PGrCkdeIjEnUUEm1tgLCN+KUXXq4vgJsEm/zw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54677},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/types.d.ts","import":"./dist/common/types.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"b9ab8d30eee0795706836e5259a47727bf466cbb","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --write .","publish":"changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.3","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","eslint-config-prettier":"^10.1.1"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.1.0_1754804084688_0.6969398890017782","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aokiapp/tlv","version":"0.1.1","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.1.1","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"3ff016e58ea0152b8333d5f4bebdca414bcfc317","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.1.1.tgz","fileCount":27,"integrity":"sha512-AvxrlmrX/W3l2ITY1W82mumA4uD7w6hDveFU5R4/sqxOQCSQ4MDV39gfP3Dkgw6i4wr3RFH3vDNO4Ua2H2Ryjw==","signatures":[{"sig":"MEUCIA7UWhIvhz6gCgbwcB017kZFJ8JNFSrP1XEPzgqMU1zHAiEAtkbjNaYNGqkHWCh5p6dGo0Z5AadnbK5xFCzuEHll7DI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61592},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/types.d.ts","import":"./dist/common/types.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"0fbf45a6656a4855fb0e8fc78708397a809c9f2e","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --write .","publish":"changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.3","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","eslint-config-prettier":"^10.1.1"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.1.1_1754813588420_0.04603700669661914","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aokiapp/tlv","version":"0.2.1","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.2.1","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"c4c164af4f9cc6068c6e2fbc27d577fb2ce11e95","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.2.1.tgz","fileCount":30,"integrity":"sha512-YYT56bVFRLj5SUo4WpcS3rrD1+RCJLxPLVlhcuf7jEzs5zAMYnpOrDaO3rseD2KTOfF9PUIuJOMNNPO+/GPvLQ==","signatures":[{"sig":"MEUCIBrqwX2yJ05K6kLPMTEFy7gJsVYdunal5lkv9kDWKGmVAiEA7eJ8wbDULgpPjq8hGL7DQAfaFSNH7ZPO/oCFt4Fa55g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78061},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/types.d.ts","import":"./dist/common/types.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"602ab917c7786800bbd9f1520949618beb6baae5","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --write .","publish":"changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.3","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","eslint-config-prettier":"^10.1.1"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.2.1_1760391662718_0.43899902759282416","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aokiapp/tlv","version":"0.3.0","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.3.0","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"63df75241ca444a59f4b47db2968fe22b97d34aa","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.3.0.tgz","fileCount":33,"integrity":"sha512-Rd1loVfv4hbWH1358tmymVvoFquDyhrzMRWbgVk91btECZ/9yIx4cZ1v/EXZK8L6oKnJI7FrFZElnRjrsUwYGQ==","signatures":[{"sig":"MEQCIF4UR+Jf0pzul/0r7jiBm9Qq0+JdT0VollB9i7ItjJkYAiBTd4Uoed0MnMjICQ++C+4swBvvqZlUB6hpHnpWwUkvKg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82702},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/index.d.ts","import":"./dist/common/index.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"c4d11ecb2ade8915bd69aa5529fc30fcd2af528f","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --write .","prepack":"npm run build","publish":"npm run build && changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.3","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","eslint-config-prettier":"^10.1.1","@vitest/coverage-istanbul":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.3.0_1761026182939_0.3862625032441065","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@aokiapp/tlv","version":"0.3.1","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.3.1","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"ed4cb8e5ac4011a6eac5e38ee43aadbb2af191a9","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.3.1.tgz","fileCount":33,"integrity":"sha512-ZLmKh13gKKUu/OeSnlv+majDP/Ydl/Ntw5KMcc9xF/UUvmJedog/Fqf8Hrjkk2VozDyJBDrzmcqKW4CNJFzXVg==","signatures":[{"sig":"MEYCIQCgdNSyBc8m7N+a+ByaKDlBc9V7WhdxOxkkq2ctFvSlPQIhAL6xxvG5KmiU+tN0H66wtodYq+5+sEiEdlSIYNt4t95R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82707},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/index.d.ts","import":"./dist/common/index.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"d9283bc41d3f2ff6cefcb56a957b087bcf93104a","scripts":{"lint":"eslint .","test":"vitest run","build":"tsc","format":"prettier --write .","prepack":"npm run build","release":"npm run build && changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.3","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","eslint-config-prettier":"^10.1.1","@vitest/coverage-istanbul":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.3.1_1761132012559_0.692005614085506","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aokiapp/tlv","version":"0.4.0","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"url":"AokiApp Inc.","name":"株式会社AokiApp","email":"https://aoki.app"},"license":"SEE LICENSE IN LICENSE.md","_id":"@aokiapp/tlv@0.4.0","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"homepage":"https://github.com/AokiApp/tlv#readme","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"dist":{"shasum":"f73f81fc31037ced5d9000d6606216a9d2257853","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.4.0.tgz","fileCount":33,"integrity":"sha512-h7PpQnC76xmmycvxJnFuGdXoact11Y2O+Ve0XGwjwb+EYRz4mlIW+XNudDWHYFJvuzThFIMi4MnKrcT0Mz8GCw==","signatures":[{"sig":"MEUCIAQZCMHDKyT87SiaXtKV6VLlZj88bWQsI4axHf9ElmvXAiEA6E45lI/w0lPLfnHfsDZ9/8WORLZ+yBQxu8HG0+Knu6Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82857},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./common":{"types":"./dist/common/index.d.ts","import":"./dist/common/index.js"},"./parser":{"types":"./dist/parser/index.d.ts","import":"./dist/parser/index.js"},"./builder":{"types":"./dist/builder/index.d.ts","import":"./dist/builder/index.js"}},"gitHead":"a8d838906572caced744fcfec23965fdf7f879b9","scripts":{"lint":"eslint .","test":"tsc -p tests/tsconfig.json --emitDeclarationOnly && vitest run","build":"tsc","format":"prettier --write .","prepack":"npm run build","release":"npm run build && changeset publish","version":"changeset version","changelog":"changeset","typecheck":"tsc --noEmit"},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"repository":{"url":"git+https://github.com/AokiApp/tlv.git","type":"git"},"_npmVersion":"10.9.4","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.31.0","rimraf":"^5.0.5","vitest":"^3.1.1","prettier":"^3.5.3","@eslint/js":"^9.24.0","typescript":"^5.8.3","@changesets/cli":"^2.29.5","typescript-eslint":"^8.29.0","vite-tsconfig-paths":"^5.1.4","eslint-config-prettier":"^10.1.1","@vitest/coverage-istanbul":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/tlv_0.4.0_1764152365126_0.7242768961455726","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@aokiapp/tlv","version":"0.4.1","description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./parser":{"import":"./dist/parser/index.js","types":"./dist/parser/index.d.ts"},"./builder":{"import":"./dist/builder/index.js","types":"./dist/builder/index.d.ts"},"./common":{"import":"./dist/common/index.js","types":"./dist/common/index.d.ts"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier --write .","test":"tsc -p tests/tsconfig.json --emitDeclarationOnly && vitest run","prepack":"npm run build","changelog":"changeset","version":"changeset version","release":"npm run build && changeset publish"},"keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"author":{"name":"株式会社AokiApp","email":"https://aoki.app","url":"AokiApp Inc."},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://github.com/AokiApp/tlv#readme","repository":{"type":"git","url":"git+https://github.com/AokiApp/tlv.git"},"devDependencies":{"@changesets/cli":"^2.29.5","@eslint/js":"^9.24.0","@vitest/coverage-istanbul":"^3.2.4","eslint":"^9.31.0","eslint-config-prettier":"^10.1.1","prettier":"^3.5.3","rimraf":"^5.0.5","typescript":"^5.8.3","typescript-eslint":"^8.29.0","vite-tsconfig-paths":"^5.1.4","vitest":"^3.1.1"},"_id":"@aokiapp/tlv@0.4.1","gitHead":"9889a30d97cb21c7be2f384f36aae678f3cb32a1","bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-aaC8/gHvTTgoEC8CMa4ncWWGTJr02pZH2Pa8pDulX+35FFXq58fnDKFjZFGph1deq9WINXopIMiktbiXLKmvdQ==","shasum":"16025aaeacd3c0637563d851551a11bdacf3bc6e","tarball":"https://registry.npmjs.org/@aokiapp/tlv/-/tlv-0.4.1.tgz","fileCount":33,"unpackedSize":84922,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICphbQuCGKmdDJZchCejV4IVoZxFexQP1Mon769dPYLZAiEAvXDPVbAo3t3nowibD4ROfffbKg4H+e9P5E30OGL/TeM="}]},"_npmUser":{"name":"yuki-js","email":"ayukiyhs@gmail.com"},"directories":{},"maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tlv_0.4.1_1765599362741_0.05245652780462362"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-10T05:34:44.566Z","modified":"2025-12-13T04:16:03.128Z","0.1.0":"2025-08-10T05:34:44.867Z","0.1.1":"2025-08-10T08:13:08.621Z","0.2.1":"2025-10-13T21:41:03.014Z","0.3.0":"2025-10-21T05:56:23.134Z","0.3.1":"2025-10-22T11:20:12.761Z","0.4.0":"2025-11-26T10:19:25.326Z","0.4.1":"2025-12-13T04:16:02.895Z"},"bugs":{"url":"https://github.com/AokiApp/tlv/issues"},"author":{"name":"株式会社AokiApp","email":"https://aoki.app","url":"AokiApp Inc."},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://github.com/AokiApp/tlv#readme","keywords":["tlv","parser","builder","tag-length-value","asn1","schema","encoding","smartcard"],"repository":{"type":"git","url":"git+https://github.com/AokiApp/tlv.git"},"description":"Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.","maintainers":[{"name":"yuki-js","email":"ayukiyhs@gmail.com"}],"readme":"# @aokiapp/tlv\n\nTag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.\n\n## Features\n\n- **Schema-based TLV parsing and building**: Define structured schemas for complex TLV data\n- **DER encoding support**: Full compliance with Distinguished Encoding Rules\n- **Modular API**: Separate parser and builder modules for focused usage\n- **TypeScript-first**: Complete type safety with inferred types from schemas\n- **ASN.1 compatible**: Support for various ASN.1 constructs (SEQUENCE, SET, primitives, etc.)\n- **Real-world examples**: Includes CMS (RFC 5652) and CRCL implementations\n\n## Installation\n\n### From npm\n\n```bash\nnpm install @aokiapp/tlv\n```\n\n### From GitHub Packages\n\n**Note**: GitHub Packages requires authentication even for public packages.\n\nFirst, authenticate with GitHub:\n\n```bash\nnpm login --registry=https://npm.pkg.github.com\n```\n\nThen install:\n\n```bash\nnpm install @aokiapp/tlv --registry=https://npm.pkg.github.com\n```\n\nOr configure your `.npmrc`:\n\n```\n@aokiapp:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN\n```\n\n## Quick Start\n\n### Basic TLV Parsing\n\n```typescript\nimport { BasicTLVParser } from \"@aokiapp/tlv/parser\";\n\n// Parse raw TLV data\nconst buffer = new Uint8Array([0x04, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f])\n  .buffer;\nconst tlv = BasicTLVParser.parse(buffer);\n\nconsole.log(tlv);\n// {\n//   tag: { tagClass: 0, constructed: false, tagNumber: 4 },\n//   length: 5,\n//   value: ArrayBuffer(...),\n//   endOffset: 7\n// }\n```\n\n### Schema-based Parsing\n\n```typescript\nimport { SchemaParser, Schema, TagClass } from \"@aokiapp/tlv/parser\";\nimport { decodeUtf8, decodeInteger } from \"@aokiapp/tlv/common\";\n\n// Define a schema for a person record\nconst PersonSchema = Schema.constructed(\"person\", { tagNumber: 16 }, [\n  Schema.primitive(\"id\", { tagNumber: 2 }, decodeInteger),\n  Schema.primitive(\"name\", { tagNumber: 12 }, decodeUtf8),\n  Schema.primitive(\"email\", { tagNumber: 12, optional: true }, decodeUtf8),\n]);\n\n// Parse TLV data according to schema\nconst parser = new SchemaParser(PersonSchema);\nconst result = parser.parse(tlvBuffer);\n\n// Result is fully typed:\n// { id: number, name: string, email?: string }\n```\n\n### Schema-based Building\n\n```typescript\nimport { SchemaBuilder, Schema } from \"@aokiapp/tlv/builder\";\nimport { encodeUtf8, encodeInteger } from \"@aokiapp/tlv/common\";\n\n// Define builder schema\nconst PersonSchema = Schema.constructed(\"person\", { tagNumber: 16 }, [\n  Schema.primitive(\"id\", { tagNumber: 2 }, encodeInteger),\n  Schema.primitive(\"name\", { tagNumber: 12 }, encodeUtf8),\n]);\n\n// Build TLV data from structured input\nconst builder = new SchemaBuilder(PersonSchema);\nconst tlvBuffer = builder.build({\n  id: 123,\n  name: \"John Doe\",\n});\n```\n\n## API Reference\n\n### Parser Module (`@aokiapp/tlv/parser`)\n\n#### `BasicTLVParser`\n\nLow-level TLV parsing for raw DER/BER data.\n\n```typescript\nclass BasicTLVParser {\n  static parse(buffer: ArrayBuffer): TLVResult;\n}\n```\n\n**Parameters:**\n\n- `buffer: ArrayBuffer` - Raw TLV data to parse\n\n**Returns:**\n\n- [`TLVResult`](src/common/types.ts:15) - Parsed structure with tag, length, value, and endOffset\n\n**Throws:**\n\n- Error if indefinite length (0x80) is encountered (DER compliance)\n- Error if declared length exceeds available bytes\n\n**Example:**\n\n```typescript\nconst buffer = new Uint8Array([0x04, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f])\n  .buffer;\nconst result = BasicTLVParser.parse(buffer);\n// Returns: {\n//   tag: { tagClass: 0, constructed: false, tagNumber: 4 },\n//   length: 5,\n//   value: ArrayBuffer(5), // \"Hello\"\n//   endOffset: 7\n// }\n```\n\n#### `SchemaParser`\n\nSchema-driven TLV parsing with full type inference.\n\n```typescript\nclass SchemaParser {\n  constructor(schema: TLVSchema, options?: { strict?: boolean });\n  parse(buffer: ArrayBuffer): any; // Fully typed based on schema\n}\n```\n\n**Constructor Parameters:**\n\n- `schema: TLVSchema` - TLV schema definition\n- `options.strict?: boolean` - Enable strict validation (default: true)\n\n**Methods:**\n\n##### `parse(buffer: ArrayBuffer): any`\n\nParse TLV data according to schema with full type inference.\n\n**Parameters:**\n\n- `buffer: ArrayBuffer` - DER-encoded TLV data\n\n**Returns:**\n\n- Fully typed result based on schema definition (TypeScript infers the exact type)\n\n**Behavior:**\n\n- **Strict mode (default)**: Enforces exact schema compliance, canonical SET ordering\n- **Non-strict mode**: More permissive parsing, preserves original SET order\n- **SEQUENCE**: Children must appear in exact schema order\n- **SET**: Children can appear in any order, validated for canonical ordering in strict mode\n- **Repeated fields**: Automatically collect multiple consecutive matching children\n\n**Throws:**\n\n- Error on tag class/number mismatches\n- Error on missing required fields\n- Error on unknown children (immediate failure regardless of strict mode)\n- Error on DER canonical order violations in SET (strict mode only)\n\n#### `Schema` (Parser)\n\nFactory class for creating parser schemas.\n\n```typescript\nclass Schema {\n  static primitive(\n    name: string,\n    options: SchemaOptions,\n    decode?: (buffer: ArrayBuffer) => any,\n  ): TLVSchema;\n\n  static constructed(\n    name: string,\n    options: SchemaOptions,\n    fields: TLVSchema[],\n  ): TLVSchema;\n\n  static repeated(\n    name: string,\n    options: SchemaOptions,\n    item: TLVSchema,\n  ): TLVSchema;\n}\n```\n\n### Builder Module (`@aokiapp/tlv/builder`)\n\n#### `BasicTLVBuilder`\n\nLow-level TLV building for constructing DER-encoded data.\n\n```typescript\nclass BasicTLVBuilder {\n  static build(tlv: TLVResult): ArrayBuffer;\n}\n```\n\n**Parameters:**\n\n- `tlv: TLVResult` - TLV structure to encode\n\n**Returns:**\n\n- `ArrayBuffer` - DER-encoded TLV data\n\n**Behavior:**\n\n- Supports high tag numbers (>= 31) with multi-byte encoding\n- Supports long-form length encoding (>= 128 bytes)\n- Enforces DER canonical encoding rules\n- Maximum length field: 126 bytes (BER/DER limit)\n\n**Throws:**\n\n- Error for invalid tag numbers (negative, non-finite)\n- Error for invalid tag classes (outside 0-3 range)\n- Error for values too large to encode (> 126-byte length field)\n\n**Example:**\n\n```typescript\nconst tlv: TLVResult = {\n  tag: { tagClass: TagClass.Universal, constructed: false, tagNumber: 4 },\n  length: 5,\n  value: new TextEncoder().encode(\"Hello\").buffer,\n  endOffset: 0,\n};\nconst encoded = BasicTLVBuilder.build(tlv);\n```\n\n#### `SchemaBuilder`\n\nSchema-driven TLV building with type validation.\n\n```typescript\nclass SchemaBuilder {\n  constructor(schema: TLVSchema, options?: { strict?: boolean });\n  build(data: any): ArrayBuffer; // Input type inferred from schema\n}\n```\n\n**Constructor Parameters:**\n\n- `schema: TLVSchema` - TLV schema definition\n- `options.strict?: boolean` - Enable strict validation (default: true)\n\n**Methods:**\n\n##### `build(data: any): ArrayBuffer`\n\nBuild DER-encoded TLV data from structured input.\n\n**Parameters:**\n\n- `data: any` - Input data matching schema structure (TypeScript infers exact type)\n\n**Returns:**\n\n- `ArrayBuffer` - DER-encoded TLV data\n\n**Behavior:**\n\n- **Strict mode (default)**: Validates all required fields, sorts SET children canonically\n- **Non-strict mode**: Permits missing fields, preserves SET child order\n- **Type safety**: Input data type is inferred from schema definition\n- **SET ordering**: Applies DER canonical lexicographic sorting in strict mode\n\n**Throws:**\n\n- Error on missing required properties (strict mode)\n- Error on type validation failures\n- Error on top-level repeated schemas (must be wrapped in constructed container)\n\n#### `Schema` (Builder)\n\nFactory class for creating builder schemas.\n\n```typescript\nclass Schema {\n  static primitive(\n    name: string,\n    options: SchemaOptions,\n    encode?: (data: any) => ArrayBuffer,\n  ): TLVSchema;\n\n  static constructed(\n    name: string,\n    options: SchemaOptions,\n    fields: TLVSchema[],\n  ): TLVSchema;\n\n  static repeated(\n    name: string,\n    options: SchemaOptions,\n    item: TLVSchema,\n  ): TLVSchema;\n}\n```\n\n### Schema Options\n\nAll schema factory methods accept common options:\n\n```typescript\ninterface SchemaOptions {\n  readonly tagClass?: TagClass; // Default: TagClass.Universal\n  readonly tagNumber?: number; // Required for primitives\n  readonly optional?: boolean; // Default: false\n  readonly isSet?: boolean; // Auto-inferred for UNIVERSAL 16/17\n}\n```\n\n**Tag Class Values:**\n\n- `TagClass.Universal` (0) - Standard ASN.1 types\n- `TagClass.Application` (1) - Application-specific types\n- `TagClass.ContextSpecific` (2) - Context-specific types\n- `TagClass.Private` (3) - Private types\n\n**Tag Number Inference:**\n\n- **SEQUENCE**: `tagNumber: 16` (UNIVERSAL, constructed)\n- **SET**: `tagNumber: 17` (UNIVERSAL, constructed)\n- **Custom tags**: Explicit `tagNumber` required\n\n### Utility Functions\n\n#### Encoding Functions\n\n```typescript\n// Text encoding\nfunction encodeUtf8(str: string): ArrayBuffer;\nfunction encodeAscii(str: string): ArrayBuffer;\n\n// Number encoding\nfunction encodeInteger(n: number): ArrayBuffer; // DER INTEGER encoding\nfunction encodeOID(oid: string): ArrayBuffer; // OBJECT IDENTIFIER encoding\n\n// Binary encoding\nfunction encodeBitString(bits: {\n  unusedBits: number;\n  data: Uint8Array;\n}): ArrayBuffer;\n\n// Buffer utilities\nfunction toArrayBuffer(u8: Uint8Array): ArrayBuffer;\n```\n\n#### Decoding Functions\n\n```typescript\n// Text decoding\nfunction decodeUtf8(buffer: ArrayBuffer): string;\nfunction decodeAscii(buffer: ArrayBuffer): string;\nfunction decodeShiftJis(buffer: ArrayBuffer): string;\n\n// Number decoding\nfunction decodeInteger(buffer: ArrayBuffer): number;\nfunction decodeOID(buffer: ArrayBuffer): string;\n\n// Binary decoding\nfunction decodeBitStringHex(buffer: ArrayBuffer): {\n  unusedBits: number;\n  hex: string;\n};\n\n// Buffer utilities\nfunction toHex(input: ArrayBuffer | Uint8Array): string;\nfunction bufferToArrayBuffer(buf: Buffer): ArrayBuffer;\n```\n\n### Schema Pattern Examples\n\n#### Basic Schema Types\n\n```typescript\n// Primitive field\nSchema.primitive(\"fieldName\", { tagNumber: 4 }, decodeUtf8);\n\n// Optional field\nSchema.primitive(\"optional\", { tagNumber: 5, optional: true }, decodeUtf8);\n\n// Context-specific tag [0], [1], etc.\nSchema.primitive(\n  \"contextTag\",\n  {\n    tagClass: TagClass.ContextSpecific,\n    tagNumber: 0,\n  },\n  decodeInteger,\n);\n\n// SEQUENCE (ordered container)\nSchema.constructed(\"sequence\", { tagNumber: 16 }, [\n  Schema.primitive(\"field1\", { tagNumber: 2 }, decodeInteger),\n  Schema.primitive(\"field2\", { tagNumber: 12 }, decodeUtf8),\n]);\n\n// SET (unordered container)\nSchema.constructed(\"set\", { tagNumber: 17, isSet: true }, [\n  Schema.primitive(\"a\", { tagNumber: 2 }, decodeInteger),\n  Schema.primitive(\"b\", { tagNumber: 12 }, decodeUtf8),\n]);\n\n// SEQUENCE OF (repeated items)\nSchema.constructed(\"container\", { tagNumber: 16 }, [\n  Schema.repeated(\n    \"items\",\n    {},\n    Schema.primitive(\"item\", { tagNumber: 4 }, decodeUtf8),\n  ),\n]);\n```\n\n#### Nested Structures\n\n```typescript\nconst DocumentSchema = Schema.constructed(\"document\", { tagNumber: 16 }, [\n  Schema.constructed(\"header\", { tagNumber: 16 }, [\n    Schema.primitive(\"version\", { tagNumber: 2 }, decodeInteger),\n    Schema.primitive(\"timestamp\", { tagNumber: 24 }, decodeUtf8),\n  ]),\n  Schema.constructed(\"content\", { tagNumber: 16 }, [\n    Schema.primitive(\"title\", { tagNumber: 12 }, decodeUtf8),\n    Schema.primitive(\n      \"description\",\n      { tagNumber: 12, optional: true },\n      decodeUtf8,\n    ),\n    Schema.repeated(\n      \"tags\",\n      {},\n      Schema.primitive(\"tag\", { tagNumber: 12 }, decodeUtf8),\n    ),\n  ]),\n]);\n\n// TypeScript infers:\n// {\n//   header: { version: number; timestamp: string };\n//   content: { title: string; description?: string; tags: string[] }\n// }\n```\n\n### Operating Modes\n\n#### Strict Mode (Default)\n\n```typescript\nnew SchemaParser(schema, { strict: true }); // Default\nnew SchemaBuilder(schema, { strict: true });\n```\n\n- **Validation**: Enforces exact schema compliance\n- **SET ordering**: Validates/applies DER canonical ordering\n- **Error handling**: Fails fast on any schema violations\n\n#### Non-Strict Mode\n\n```typescript\nnew SchemaParser(schema, { strict: false });\nnew SchemaBuilder(schema, { strict: false });\n```\n\n- **Flexibility**: More permissive parsing/building\n- **SET ordering**: Preserves original order\n- **Performance**: Faster with less validation overhead\n\n### Error Handling\n\n```typescript\ntry {\n  const result = new SchemaParser(schema).parse(buffer);\n} catch (error) {\n  // Detailed error messages for debugging:\n  // - \"TLV tag mismatch for primitive 'fieldName'\"\n  // - \"Missing required property 'fieldName'\"\n  // - \"DER canonical order violation in SET 'setName'\"\n  console.error(\"Parse failed:\", error.message);\n}\n```\n\n### Advanced Usage\n\n#### Custom Codecs\n\n```typescript\n// Custom timestamp codec\nfunction decodeTimestamp(buffer: ArrayBuffer): Date {\n  const iso = new TextDecoder().decode(buffer);\n  return new Date(iso);\n}\n\nconst schema = Schema.primitive(\"created\", { tagNumber: 24 }, decodeTimestamp);\n// Result type automatically inferred as Date\n```\n\n## Development\n\n### Build\n\n```bash\nnpm run build          # Compile TypeScript\nnpm run typecheck      # Type checking only\n```\n\n### Testing\n\n```bash\nnpm test              # Run tests\n```\n\n### Code Quality\n\n```bash\nnpm run lint          # ESLint\nnpm run format        # Prettier\n```\n\n### Release\n\nThis library is automatically published to both npm and GitHub Packages via GitHub Actions.\n\n```bash\nnpm run changelog     # Create changeset\nnpm run version       # Update version\nnpm run publish       # Publish manually (for testing, otherwise use GitHub Actions)\n```\n\nWhen changes are pushed to the `main` branch with a changeset, the GitHub Actions workflow will:\n\n1. Create a release PR or publish to npm\n2. Automatically publish to GitHub Packages if npm publish succeeds\n\n## Project Structure\n\n```\n├── src/\n│   ├── parser/          # TLV parsing functionality\n│   ├── builder/         # TLV building functionality\n│   ├── common/          # Shared types and utilities\n│   └── utils/           # Encoding/decoding utilities\n├── examples/\n│   ├── cms/             # CMS (RFC 5652) examples\n│   └── crcl/            # CRCL certificate request examples\n├── tests/               # Test suite\n└── dist/                # Compiled output\n```\n\n## Supported Encoders/Decoders\n\nThe library includes various built-in codecs:\n\n- **Text**: UTF-8, ASCII, Shift-JIS\n- **Numbers**: INTEGER (DER encoding)\n- **Identifiers**: OBJECT IDENTIFIER\n- **Binary**: BIT STRING, OCTET STRING\n- **Utility**: Hex conversion, buffer operations\n\n## TypeScript Support\n\nFull TypeScript support with:\n\n- Schema type inference for parsing results\n- Compile-time validation of builder input data\n- Optional/required field type safety\n- Generic schema composition\n\n## License\n\nThis project is licensed under the AokiApp Normative Application License - Tight. See [`LICENSE.md`](LICENSE.md:1) for details.\n\n**Note**: This is NOT an open source license. The source code is made publicly visible for transparency only. Commercial use requires explicit written permission from AokiApp Inc.\n\n## Contributing\n\nThis project is currently under restrictive licensing. For contribution guidelines or commercial licensing inquiries, please contact AokiApp Inc. at hello+github@aoki.app.\n\n## Changelog\n\nSee [`CHANGELOG.md`](CHANGELOG.md:1) for version history and changes.\n","readmeFilename":"README.md"}