UNPKG

gff-nostream

Version:

utilities to read GFF3 data

25 lines 691 B
import Parser from './parse'; /** * Synchronously parse a string containing GFF3 and return an array of the * parsed items. * * @param str - GFF3 string * @param inputOptions - Parsing options * @returns array of parsed features, directives, comments and/or sequences */ export function parseStringSync(str) { const items = []; const parser = new Parser({ featureCallback: arg => items.push(arg), disableDerivesFromReferences: true, errorCallback: err => { throw err; }, }); for (const line of str.split(/\r?\n/)) { parser.addLine(line); } parser.finish(); return items; } //# sourceMappingURL=api.js.map