Skip to content

v1.1.0 - Updates the work typings and the ability to select returned fields

Latest
Compare
Choose a tag to compare
@jamesgopsill jamesgopsill released this 10 Feb 14:21

This release updates the types for the Works as per #2

It also adds the ability to select the fields to be returned. E.g.,

import {
	CrossrefClient,
	QueryWorksParams,
	WorkSelectOptions,
} from "@jamesgopsill/crossref-client"

const client = new CrossrefClient()

const search: QueryWorksParams = {
	queryAuthor: "Richard Feynman",
	select: [WorkSelectOptions.CONTENT_DOMAIN],
	sample: 10,
}
const r = await client.works(search)
if (r.ok && r.status == 200) console.log(r.content)