npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jamesgopsill/gtr-client

v1.1.3

Published

A Typescript Client for the gateway to research (gtr) UKRI API.

Downloads

2

Readme

A TS client for the GtR API

GitHub package.json version GitHub repo size GitHub

GitHub package.json dynamic

GitHub package.json dynamic

This client is a fully-typed Typescript client for the UKRI's Gateway to Research GtR-2 API. It runs both on server (Node.js v18+) and client-side (Browser) javascript providing both ESM and CommonJS modules.

Contents

Getting Started

To install the package, use the following code (npm, pnpm or yarn).

pnpm install @jamesgopsill/gtr-client

You can then use package in your code like so (see the examples folder for more implementations):

Typescript

import {
	FundsQuery,
	FundsSearchFields,
	GtrClient,
} from "@jamesgopsill/gtr-client"

const client = new GtrClient(true)

const query: FundsQuery = {
	query: "epsrc",
	searchFields: [FundsSearchFields.FUNDER_ORGANISATION_NAME],
	pageSize: 10,
}

const r = await client.getFunds(query)
if (r.ok) console.log(r.data)

Javascript (ESM)

import { GtrClient, FundsSearchFields } from "@jamesgopsill/gtr-client"

const client = new GtrClient(true)

const query = {
	query: "epsrc",
	searchFields: [FundsSearchFields.FUNDER_ORGANISATION_NAME],
	pageSize: 10,
}

const r = await client.getFunds(query)
if (r.ok) console.log(r.data)

Javascript (CommonJS)

const gtr = require("@jamesgopsill/gtr-client")

const performQuery = async () => {
	const client = new gtr.GtrClient(true)

	const query = {
		query: "epsrc",
		searchFields: [gtr.FundsSearchFields.FUNDER_ORGANISATION_NAME],
		pageSize: 10,
	}

	const r = await client.getFunds(query)
	if (r.ok) console.log(r.data)
}

performQuery()

Docs

The docs have been produced using TypeDoc and can be accessed here.

Roadmap

| Version | Content | Status | | ------- | ----------------------------------------------------------- | ------ | | 0.0.1 | Repo up and running | ✔ | | 0.2.0 | /funds implemented. | ✔ | | 0.3.0 | /organisations implemented. | ✔ | | 0.4.0 | /outcomes implemented. | ✔ | | 0.5.0 | /persons implemented. | ✔ | | 0.6.0 | /projects implemented. | ✔ | | 0.7.0 | Simplified client using interface conditionals. | ✔ | | 0.8.0 | Refactored again to use programmatically defined functions. | ✔ | | 0.9.0 | Custom Filtering Param Interfaces | ✔ | | 0.11.0 | Changing how the response is handled. | ✔ | | 1.0.0 | Spec complete. | ✔ | | 1.1.0 | Updating types and supporting ESM and CommonJS. | ✔ |

Contributing

We would love to have additional contributors to the project to help us maintain and add functionality to the project. Please use pnpm pre-add before committing to the repository.

Note. if wanting to run the examples as you develop the repo. Use pnpm link . to link the repo to your available packages.

Support the Project

If you like this project, please consider sponsoring the developers so they can continue to maintain and improve the package.

References