{"_id":"@peculiar/asn1-schema@3.0.0","bugs":{"url":"https://github.com/PeculiarVentures/asn1-schema/issues"},"dist":{"shasum":"5a17c37cfbc0c91c6d0c277b159336250c8fd266","tarball":"http://registry-npm.ywwl.com/@peculiar/asn1-schema/download/@peculiar/asn1-schema-3.0.0.tgz","fileCount":30,"integrity":"sha512-VQgBSyf3teIp7219Y0rHFruJUVY/teYkKvvvObuwtwx6+jOt1f1+jvZoTBRua370H0a8eYpnUWoe0G6GqV0yaA==","signatures":[{"sig":"MEYCIQCFRkjTpmLHB2ow8N7X2CPlN7rGDY94GdKP/BIU1l5afwIhANmMK+HdYEVlBkRIQBxwKghFR9ixFLweT3PNKVJhI2k/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5b/yjrd7Xni0CZzaSqLFFiKDPVX3uaOrookGY/2yyYgIgNIlKblzm4E4TeLjir0CN656BRSsxKIJLsmZ3Aldqsio="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@peculiar%2fasn1-schema@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54515,"size":12853,"noattachment":false,"key":"/@peculiar/asn1-schema/-/@peculiar/asn1-schema-3.0.0.tgz"},"main":"./build/index.js","name":"@peculiar/asn1-schema","type":"module","types":"./build/index.d.ts","author":{"name":"PeculiarVentures, LLC"},"module":"./build/index.js","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":"./build/index.js","./package.json":"./package.json"},"gitHead":"879a6eef4eba45ebb5e98a0fafe6c2792acd34f2","license":"MIT","version":"3.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"f2543879-b77e-437e-907f-edbc0cfa52b3"}},"homepage":"https://github.com/PeculiarVentures/asn1-schema/tree/master/packages/schema#readme","keywords":["asn","asn1","schema","serialize","parse","decorator","der"],"repository":{"url":"git+https://github.com/PeculiarVentures/asn1-schema.git","type":"git","directory":"packages/schema"},"_npmVersion":"11.19.0","description":"Decorators and helper APIs for declaring ASN.1 schemas in TypeScript.","directories":{},"maintainers":[{"name":"rmhrisk","email":"ryan_hurst@hotmail.com"},{"name":"microshine","email":"microshine@mail.ru"},{"name":"yury.strozhevsky","email":"yury@strozhevsky.com"},{"name":"peculiarventures","email":"info@peculiarventures.com"},{"name":"apilguk","email":"apilguk@gmail.com"},{"name":"donskov","email":"donskovdmitriyv@gmail.com"},{"name":"worldthirteen","email":"mihailzachepilo@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.21.0","contributors":[{"name":"Ryan Hurst","email":"rmh@unmitigatedrisk.com"},{"name":"Miroshin Stepan","email":"microshine@mail.ru"}],"dependencies":{"@peculiar/utils":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"asn1js":"^4.0.0"},"peerDependencies":{"asn1js":"^4.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/asn1-schema_3.0.0_1793013869753_0.8178536412982209"},"readme":"# `@peculiar/asn1-schema`\n\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/PeculiarVentures/asn1-schema/blob/master/packages/schema/LICENSE)\n[![npm version](https://badge.fury.io/js/%40peculiar%2Fasn1-schema.svg)](https://badge.fury.io/js/%40peculiar%2Fasn1-schema)\n\n[![NPM](https://nodei.co/npm/@peculiar/asn1-schema.png)](https://nodei.co/npm/@peculiar/asn1-schema/)\n\nDecorators and helper APIs for declaring ASN.1 schemas in TypeScript.\n\nThis is the core package used by the schema modules in this repository. It lets you describe DER structures with decorators and convert them with `AsnConvert`, `AsnParser`, and `AsnSerializer`.\n\n## Installation\n\n```bash\nnpm install @peculiar/asn1-schema\n```\n\n## Breaking Changes In v3\n\nv3 is ESM-only and requires Node.js `^20.19.0 || >=22.12.0` (was `>=14`). CommonJS code can still `require(\"@peculiar/asn1-schema\")` on these versions; Node.js 22.0–22.11 can't. The public API is unchanged. See the [full notes](https://github.com/PeculiarVentures/asn1-schema#breaking-changes-in-v3).\n\n- **TypeScript compiling to CommonJS:** use `\"module\": \"node20\"` or `\"nodenext\"` (`node16` fails with TS1479). ESM and bundler setups need no changes.\n- **Jest in CommonJS mode:** switch to ESM mode or Vitest, or configure an ESM-to-CommonJS transformer and make sure `transformIgnorePatterns` doesn't exclude the `@peculiar/*` packages and `asn1js`.\n- **Deep imports** (`@peculiar/asn1-schema/build/...`) are blocked by `exports`; import from `@peculiar/asn1-schema`.\n- **asn1js 4 is a peer dependency** (v2 depended on asn1js 3). npm installs it automatically; if your app imports `asn1js` too, use v4. The converters check `instanceof asn1js.*`, so values you pass in must come from the same asn1js copy. See the [asn1js 4 breaking changes](https://github.com/PeculiarVentures/ASN1.js#breaking-changes-in-v4) for encoding differences.\n\n## Overview\n\nAbstract Syntax Notation One (ASN.1) is widely used across X.509, PKCS, CMS, OCSP, and related standards. This package keeps those mappings declarative and type-friendly by attaching schema metadata directly to classes.\n\n## TypeScript Example\n\n```ts\nimport { AsnConvert, AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from \"@peculiar/asn1-schema\";\n\n@AsnType({ type: AsnTypeTypes.Sequence })\nclass BasicConstraints {\n  @AsnProp({ type: AsnPropTypes.Boolean, defaultValue: false })\n  public cA = false;\n}\n\nconst basicConstraints = new BasicConstraints();\nbasicConstraints.cA = true;\n\nconst encoded = AsnConvert.serialize(basicConstraints);\nconst decoded = AsnConvert.parse(encoded, BasicConstraints);\n\nconsole.log(decoded.cA);\n```\n\n## Related Links\n\n- [Decorators overview](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841)\n- [ASN.1 playground](http://lapo.it/asn1js/)\n","publish_time":1793013869836,"_cnpm_publish_time":1793013869836,"dist-tags":{"latest":"3.0.0"}}