{"id":21457909,"url":"https://github.com/iktos/rdkit-provider","last_synced_at":"2026-01-19T10:07:21.248Z","repository":{"id":65501000,"uuid":"593413036","full_name":"iktos/rdkit-provider","owner":"iktos","description":"instantiate an RDKit web worker in a React context","archived":false,"fork":false,"pushed_at":"2025-03-20T09:43:40.000Z","size":942,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-01T16:22:24.785Z","etag":null,"topics":["cheminformatics","rdkit","rdkit-chem","react","typescript","webworker","webworkers"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iktos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-01-25T23:37:51.000Z","updated_at":"2025-03-20T09:43:16.000Z","dependencies_parsed_at":"2023-03-30T13:03:07.223Z","dependency_job_id":"a910ec8f-af79-4e93-b44e-a77a03d67cf6","html_url":"https://github.com/iktos/rdkit-provider","commit_stats":{"total_commits":21,"total_committers":4,"mean_commits":5.25,"dds":"0.19047619047619047","last_synced_commit":"797b45a777b82883b48ab48a3bc01786b549b94f"},"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/iktos/rdkit-provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Frdkit-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Frdkit-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Frdkit-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Frdkit-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iktos","download_url":"https://codeload.github.com/iktos/rdkit-provider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktos%2Frdkit-provider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263245647,"owners_count":23436525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheminformatics","rdkit","rdkit-chem","react","typescript","webworker","webworkers"],"created_at":"2024-11-23T06:16:10.160Z","updated_at":"2026-01-19T10:07:21.221Z","avatar_url":"https://github.com/iktos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdkit-provider\n\nInitialises a web worker with `RDKitModule` instance from [@rdkit/rdkit](https://github.com/rdkit/rdkit-js) and exposes it via a react context\n\n## Setup\n\n#### Assets\n\nThe project using this package needs to provide it with [RDKit package assets](https://github.com/rdkit/rdkit/tree/master/Code/MinimalLib#using-the-rdkit-package-assets)\n\nAfter installing [@rdkit/rdkit](https://github.com/rdkit/rdkit-js) copy to your public folder\n`node_modules/@iktos-oss/rdkit-provider/lib/rdkit-worker*.js`\n`node_modules/@rdkit/rdkit/dist/RDKit_minimal.js`\n`node_modules/@rdkit/rdkit/dist/RDKit_minimal.wasm`\n\n## Usage\n\nWrap your components/App with `RDKitProvider`\n\n```html\nimport { RDKitProvider } from '@iktos/rdkit-provider';\n\u003cRDKitProvider\u003e\n  \u003cComponent /\u003e\n\u003c/RDKitProvider\u003e\n```\n\nyou can also enable caching for molecule, which would enhance performance\n\n```html\nimport { RDKitProvider } from '@iktos/rdkit-provider';\n\u003cRDKitProvider cache={{ enableJsMolCaching: true, maxJsMolsCached: 50 }}\u003e\n  \u003cComponent /\u003e\n\u003c/RDKitProvider\u003e\n```\n\nOptions that can be passed to `RDKitProvider `:\n\n| prop                    | type                                                                                      | functionality                                                                                                                                                                                                                        | required/optional |\n| ----------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |\n| `cache`                   | `RDKitProviderCacheOptions = { enableJsMolCaching?: boolean; maxJsMolsCached?: number; }` | enables `JSMol` caching for better performance                                                                                                                                                                                       | optional          |\n| `preferCoordgen`          | `boolean`                                                                                 | will be passed to [@rdkit/rdkitjs prefer_coordgen](https://docs.rdkitjs.com/interfaces/RDKitModule.html#prefer_coordgen.prefer_coordgen-1) to use Schrodinger’s open-source Coordgen library to generate 2D coordinates of molecules | optional          |\n| `removeHs`                | `boolean`                                                                                 | toggles removing hydrogens molecules. Defaults to true                                                                                                                                                                               | optional          |\n| `initialWorkerInstance` | `Worker` instance of `rdkit-worker.js`                                                    | pass an rdkit worker instance, if not passed rdkit-provider creates one for you                                                                                                                                                      | optional          |\n| `rdkitPath`             | `string` default to `/RDKit_minimal.js` in `initRDKit.ts`                                 | pass a custom path to rdkit module                                                                                                                                                                                                   | optional          |\n| `rdkitWorkerPublicFolder`       | `string`, default is '', meaning the file is at the root level of the public folder                                | path to the folder containing the rdkit-worker-[version].js relative to the public folder                                                                                                                                                                                                | optional          |\n\nYou can make use of a set of helper functions exposed by the package\n\n```js\nimport { useRDKitUtils, useRDKit } from '@iktos/rdkit-provider';\n\nconst Component = () =\u003e {\n  const { worker } = useRDKit();\n  const { isValidSmiles } = useRDKitUtils();\n  const submit = useCallback(\n    async (smiles) =\u003e {\n      const { isValid } = await isValidSmiles({ smiles });\n      if (!isValid) return;\n      // ...\n    },\n    [isValidSmiles],\n  );\n\n  if (!worker) return 'loading ...';\n  return \u003c\u003e...\u003c/\u003e;\n  //...\n};\n```\n\nExample of usage can be found in [github.com/iktos/molecule-representation](https://github.com/iktos/molecule-representation)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktos%2Frdkit-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiktos%2Frdkit-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktos%2Frdkit-provider/lists"}