Asynchronously iterate over molecules from a text-decoded SDF stream.
A ReadableStream<string> supplying SDF text content.
ReadableStream<string>
Iterator options.
Individual molecule objects.
import { openAsBlob } from 'node:fs';import { iterator } from 'sdf-parser';const blob = await openAsBlob('compounds.sdf');const textDecoder = new TextDecoderStream();for await (const molecule of iterator(blob.stream().pipeThrough(textDecoder))) { console.log(molecule.molfile);} Copy
import { openAsBlob } from 'node:fs';import { iterator } from 'sdf-parser';const blob = await openAsBlob('compounds.sdf');const textDecoder = new TextDecoderStream();for await (const molecule of iterator(blob.stream().pipeThrough(textDecoder))) { console.log(molecule.molfile);}
Asynchronously iterate over molecules from a text-decoded SDF stream.