pg-rdf-to-json
Version:
Transforms RDF files from rdf-files.tar.bz2 provided by Project Gutenberg into JS/JSON objects.
23 lines • 965 B
TypeScript
import internal from 'node:stream';
import { bookSchema, type Book, type File, type Agent, type Resource } from './types.js';
/** Re-export types for use downstream. */
export { bookSchema, Book, File, Agent, Resource, };
/**
* Accepts a {@link internal.Readable} stream of XML text. This function will
* parse each XML file and yield each parsed document as a
* {@link Book}.
*
* @param stream A Readable stream of XML text.
*/
export declare function booksFromStream(stream: internal.Readable): AsyncGenerator<Book, void, unknown>;
/**
* Spawns `tar -lxOf $pathToArchive`, passes the resulting stream to
* {@link booksFromStream} and yields each resulting {@link Book}.
*
* @throws Will throw the contents of `tar`'s `stderr` if it does not exit
* cleanly.
*
* @param pathToArchive The path to a TAR archive.
*/
export declare function booksFromArchive(pathToArchive: string): AsyncGenerator<Book, void, unknown>;
//# sourceMappingURL=index.d.ts.map