astrocite-eutils
    TypeScript icon, indicating that this package has built-in type declarations

    0.16.4 • Public • Published

    astrocite-eutils

    A helper library for converting PubMed EUtils ESummary JSON to CSL JSON.

    See astrocite for more details.

    API

    toCSL(apiResponse)

    Returns: Array<CSL.Data | EUtilsError>

    Where EUtilsError has the following interface

    interface EUtilsError extends Error {
        /**
         * If the error occured on a single reference, then this is set with the identifier of that
         * reference
         */
        uid?: string;
        /**
         * True if the error is a global API-level error. Otherwise the Error occured on a single
         * reference (i.e, some of the request produced a valid result.)
         **/
        apiError: boolean;
    }

    apiResponse

    Type: Object

    The entire JSON response received from the PubMed EUtils ESummary API

    Usage

    import { toCSL } from 'astrocite-eutils';
     
    // Assume apiResponse is the JSON received from the EUtils ESummary API
    const cslJSON = toCSL(apiResponse);

    Keywords

    none

    Install

    npm i astrocite-eutils

    DownloadsWeekly Downloads

    699

    Version

    0.16.4

    License

    MIT

    Unpacked Size

    19.7 kB

    Total Files

    13

    Last publish

    Collaborators

    • dsifford