{"library":"ord-schema","title":"Open Reaction Database Schema (JavaScript)","description":"The `ord-schema` package provides JavaScript and TypeScript wrappers for interacting with the Open Reaction Database (ORD) schema. The ORD project standardizes the representation of chemical reaction data, facilitating data exchange, analysis, and machine learning applications within the chemistry domain. This library offers client-side tools, primarily built on Protocol Buffers (protobuf), to create, manipulate, and validate reaction data according to the ORD specification. Currently at version 0.4.7, the package has a consistent release cadence, often addressing internal tooling, dependency updates (like Protobuf), and minor bug fixes. Its core differentiator lies in enabling structured, interoperable chemical reaction data handling.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install ord-schema"],"cli":null},"imports":["import { Reaction } from 'ord-schema';","import { validateReaction } from 'ord-schema';","import { Reaction } from 'ord-schema'; const reaction = new Reaction(); const obj = reaction.toObject();"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Reaction, validateReaction, ReactionMeasurement, Product } from 'ord-schema';\n\nconst reaction = new Reaction();\nreaction.setReactionId('my-unique-reaction-id');\n\nconst measurement = new ReactionMeasurement();\nmeasurement.setOutcome('SUCCESS');\nreaction.addMeasurements(measurement);\n\nconst product = new Product();\nproduct.setReactionProduct('my-product-smiles'); // Example SMILES string\nreaction.addProducts(product);\n\n// Add a textual description\nreaction.setText('A simple example reaction with one product and a success outcome.');\n\n// Validate the reaction object against the schema\ntry {\n  validateReaction(reaction);\n  console.log('Reaction is valid:', reaction.toObject());\n} catch (error) {\n  console.error('Reaction validation failed:', error);\n}\n\n// Example of serializing to binary (for sending over network/saving)\nconst binaryData = reaction.serializeBinary();\nconsole.log(`Serialized reaction to ${binaryData.length} bytes.`);\n\n// Example of deserializing from binary\nconst deserializedReaction = Reaction.deserializeBinary(binaryData);\nconsole.log('Deserialized reaction ID:', deserializedReaction.getReactionId());","lang":"typescript","description":"Demonstrates creating a new Reaction object, populating basic fields, performing client-side validation, and handling Protobuf serialization/deserialization.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}