1.1.0 • Published 2 years ago

@symeres/sdf-parser v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Symeres sdf parser

This parser parses a sdf file and return a collection of records as

export type IRecord = {
    molText: string | undefined;
    [key: string]: string | number | undefined;
}

Example

import {parser} from "@symeres/sdf-parser";

const content = `C8H10N4O2
...
M  END
>  <Compound Name>
Caffeine

>  <Formula>
C8H10N4O2

>  <Molweight>
194.19

$$$$`;

const records = parser(content);

records:

[
    {
        "molText": "C8H10N4O2\r\n...\r\nM  END\r\n",
        "Compound Name": "Caffeine",
        "Formula": "C8H10N4O2",
        "Molweight": "194.19"
    }
]