{"_id":"@3ditles/glb","_rev":"2-a49ee4f4f593bfe601a1c863a96ba526","name":"@3ditles/glb","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@3ditles/glb","version":"1.0.0","keywords":["glb","3d","model","parser","gltf","3d-model","webgl"],"author":"","license":"MIT","_id":"@3ditles/glb@1.0.0","maintainers":[{"name":"jvy","email":"jvy@qq.com"}],"homepage":"https://github.com/yourusername/glb#readme","bugs":{"url":"https://github.com/yourusername/glb/issues"},"dist":{"shasum":"f7b17d62bb5a2f372244690384713ccfd5739f13","tarball":"https://registry.npmjs.org/@3ditles/glb/-/glb-1.0.0.tgz","fileCount":7,"integrity":"sha512-eGXDHjJV0kie68QUq+m8Pb01bhN04v3bgxXVzRAl1GcqzXIJytSVmK0tsQSA6dQZvCxNzXg3bJSWoU0GoaZ7Yg==","signatures":[{"sig":"MEYCIQCJeYyhQkt4ES/3uYq/KuWdVYWxuD4GNTZYwtXoG4oTfgIhAPwftefM+RU9xp3QuyAv4xPuwHtE3bYB6hucjvKiaroH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16437},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"lint":"eslint . --ext .ts","test":"jest","build":"tsc","prepare":"npm run build"},"_npmUser":{"name":"jvy","email":"jvy@qq.com"},"repository":{"url":"git+https://github.com/yourusername/glb.git","type":"git"},"_npmVersion":"10.9.2","description":"A TypeScript library for parsing and processing GLB 3D model files","directories":{},"_nodeVersion":"22.15.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","ts-jest":"^29.1.2","typescript":"^5.4.5","@types/jest":"^29.5.12","@typescript-eslint/parser":"^7.11.0","@typescript-eslint/eslint-plugin":"^7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/glb_1.0.0_1757479051439_0.20986813407360905","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@3ditles/glb","version":"1.0.1","description":"A TypeScript library for parsing and processing GLB 3D model files","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","lint":"eslint . --ext .ts","prepare":"npm run build"},"keywords":["glb","3d","model","parser","gltf","3d-model","webgl"],"author":"","license":"MIT","devDependencies":{"@types/jest":"^29.5.12","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","eslint":"^8.57.0","jest":"^29.7.0","ts-jest":"^29.1.2","typescript":"^5.4.5"},"repository":{"type":"git","url":"git+https://github.com/yourusername/glb.git"},"bugs":{"url":"https://github.com/yourusername/glb/issues"},"homepage":"https://github.com/yourusername/glb#readme","_id":"@3ditles/glb@1.0.1","_nodeVersion":"22.15.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-f88tOWJh5TGTLl8jlSPhSiuPy4xHxYcPK4ed5+4fcfFgw8KYtlW92VGNhSkcAAHtAW/vSm3D3Oc/hpKaRohdjw==","shasum":"329beaf3291801a930c4c6b7947a6a8e8de43bb4","tarball":"https://registry.npmjs.org/@3ditles/glb/-/glb-1.0.1.tgz","fileCount":7,"unpackedSize":16599,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE/bcRBvq3NLSpzR0sWjdaegJUpExLR3GdICGIlvqirWAiBLjNYjjVjzzc3LAWdNBPKwMjtVL2NfHnpjBpHQ3yVqmQ=="}]},"_npmUser":{"name":"jvy","email":"jvy@qq.com"},"directories":{},"maintainers":[{"name":"jvy","email":"jvy@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glb_1.0.1_1757479332536_0.8062473168175728"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-10T04:37:31.362Z","modified":"2025-09-10T04:42:12.883Z","1.0.0":"2025-09-10T04:37:31.635Z","1.0.1":"2025-09-10T04:42:12.703Z"},"bugs":{"url":"https://github.com/yourusername/glb/issues"},"license":"MIT","homepage":"https://github.com/yourusername/glb#readme","keywords":["glb","3d","model","parser","gltf","3d-model","webgl"],"repository":{"type":"git","url":"git+https://github.com/yourusername/glb.git"},"description":"A TypeScript library for parsing and processing GLB 3D model files","maintainers":[{"name":"jvy","email":"jvy@qq.com"}],"readme":"# @3dtiles/glb\n\nA TypeScript library for parsing and processing GLB 3D model files.\n\n## Features\n\n- Parse GLB files into structured data\n- Validate GLB file integrity and structure\n- Serialize GLB data back into binary format\n- Support for GLB version 2\n- Handle both JSON and binary chunks\n\n## Installation\n\n```bash\nnpm install @3dtiles/glb\n```\n\n## Usage\n\n### Parsing a GLB file\n\n```typescript\nimport { parseGLB, validateGLB } from '@3dtiles/glb';\nimport { readFileSync } from 'fs';\n\n// Read GLB file as binary\nconst data = readFileSync('model.glb');\nconst glbFile = parseGLB(new Uint8Array(data.buffer));\n\n// Validate the parsed file\nif (validateGLB(glbFile)) {\n  console.log('Valid GLB file');\n  console.log('JSON content:', glbFile.jsonContent);\n  console.log('Has binary chunk:', !!glbFile.binaryChunk);\n} else {\n  console.error('Invalid GLB file');\n}\n```\n\n### Serializing a GLB file\n\n```typescript\nimport { serializeGLB, GLBFile } from '@3dtiles/glb';\nimport { writeFileSync } from 'fs';\n\n// Create or modify a GLBFile object\nconst glbFile: GLBFile = {\n  header: {\n    magic: 0x46546C67,\n    version: 2,\n    length: 0 // Will be calculated automatically\n  },\n  jsonContent: {\n    scenes: [{ nodes: [] }],\n    nodes: []\n  },\n  // ... add other chunks as needed\n};\n\n// Serialize to binary\nconst binaryData = serializeGLB(glbFile);\n\n// Write to file\nwriteFileSync('new-model.glb', binaryData);\n```\n\n## API\n\n### `parseGLB(data: Uint8Array): GLBFile`\n\nParses binary data into a GLBFile structure.\n\n### `validateGLB(file: GLBFile): boolean`\n\nValidates the structure and integrity of a parsed GLBFile.\n\n### `serializeGLB(file: GLBFile): Uint8Array`\n\nSerializes a GLBFile back into binary format.\n\n### [GLBParser](file://d:\\hub\\代码测试\\proj4ts\\glb-ts-library\\src\\index.ts#L23-L191) class\n\nProvides the core functionality with methods:\n- `parse(data: Uint8Array): GLBFile`\n- `validate(file: GLBFile): boolean`\n- `serialize(file: GLBFile): Uint8Array`\n\n## License\n\nMIT","readmeFilename":"README.md"}