Skip to content

Converts a sd file into a key value typescript object

Notifications You must be signed in to change notification settings

Symeres/sdf-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
    }
]

About

Converts a sd file into a key value typescript object

Resources

Stars

Watchers

Forks

Packages

No packages published