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

@http-samc/hyper

v6.0.9

Published

A Javascript SDK for Hyper's API

Downloads

4

Readme

hyper.js

A Javascript SDK for Hyper's API

Installation

Node.js Projects

npm install @http-samc/hyper

Web Projects

Coming soon!

Usage

Client Initialization

The Hyper API Client is the default export and needs to be supplied to all calls. It validates and holds your API secret key and an (optional) logger function for development purposes. Import and initialize it as follows:

import { Client } from 'hyper'

const client = Hyper('my-hyper-secret-key')

API Calls

Besides the API Client, each 'category' of endpoints are able to be imported on an as-needed basis via named imports. These are provided as namespaces and their methods correspond to available API calls. You can import them as follows:

import { License, Link, Payment, Product, Waitlist } from 'hyper'

// Use the API by calling the methods of the imported namespaces
License.get(...)

If you want to call the namespaces something different, import them directly from their respective directory as follows (you can change the names as you wish):

import * as License from './license'
import * as Link from './link'
import * as Payment from './payment'
import * as Product from './product'
import * as Waitlist from './waitlist'

// Use the API by calling the methods of the imported namespaces
License.get(...)

API Responses

This library is asynchronous, meaning that you'll need to use either await or .then() to wait for a resolved value. All endpoints return a Promise that resolves to a HyperApiResponse. This object contains the response json as-is, straight from the server with the addition of an ok boolean property for easy error checking.

Some endpoints resolve to a HyperApiPaginatedResponse, a child of HyperApiResponse. This type of response adds an intuitive .next() and .previous property, which can be used to quickly navigate paginated endpoints. They return null once you reach a page that doesn't exist, so use the has_more property (supplied on all paginated endpoints) and make sure you aren't calling a page less than 1 before calling either method.

License

This library is open-sourced under an MIT license and was written by Samarth Chitgopekar. It is not officially recognized, endorsed, or maintained by Hyper.