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

@quivers/node-driver

v2.0.10

Published

This is a node.js driver for preforming CRUD operations against the Quivers Cloudhub APIs. Requests are asynchronous, use gzip compression, and can support either 'application/json' or 'application/qhal+json' content types.

Downloads

5

Readme

Quivers Node Driver

This is a node.js driver for preforming CRUD operations against the Quivers Cloudhub & GraphHub APIs. This will eventually be paired with a node.js SDK, which will expose the domain model of the Quivers API in an easy to use package (which uses either the node.js or client javascript driver for core functionality).

How to Use

This driver is available as an NPM package.

npm install @quivers/node-driver

Once installed, it can be included in your application and used. By default, it will connect to the Live environment, with no context and no authentication.

var QuiversDriver = require("@quivers/node-driver");
var quivers = new QuiversDriver;

It can be initialized with a few different options as well.

var quivers = new QuiversDriver({
	environment:"test",
	business: "Business.RefId",
	marketplace: "Marketplace.Id",
	apikey: "User.ApiKey",
	accept: "application/qhal+json" || "application/json",
	gzip: true
});

You can also authenticate without an apikey by using Username/Password.

var quivers = new QuiversDriver;
quivers.auth("username", "password", function (err, boolWasSuccessful) { ... });

For a comprehensive explanation on how this library works, examine "examples.js". If making adjustments to this package, run "node test.js" to ensure everything works before pushing changes. An error will be thrown if something is not working correctly.

Available Functions

//HTTP GET request
quivers.get(endpoint, queryParams, callback(err, data){ ... })

//HTTP GET request, if the resource endpoint supports paging, it will fetch the all the requested data a page at a time and invoke the callback once it has all data.
quivers.pagedGet(endpoint, callback(err, data){ ... })

//HTTP POST request.
quivers.post(endpoint, data, callback(err, data){ ... })

//Authenticates as a Quivers User. Future requests will be made as an authenticated user, if it was successful.
quivers.auth(username, password, callback(err, boolWasSuccessful){ ... })

//Unauthenticates. This method will remove any authentication tokens/apikeys currently in use.
quivers.unauth(callback(err, boolWasSuccessful){ ... })

//Batch operations, allows one to specify multiple requests to make. It will perform them concurrently, and invoke the callback once all operations are complete.
quivers.batch([
	{type: "get", uri: "Resource/Method", queryParams},
	{type: "post", uri: "Resource/Method", data}
], callback(status, data) { ... })

Supported Features

  • Concurrency; the library allows for requests to be made asynchronously, with a max of 2 concurrent requests across all instances of the Quivers object at any time (to prevent issues where too many concurrent requests slow things down or fail).
  • Gzip Compression: Accepts gzip compressed responses from the API, and any data sent to the API will also be gzipped to minimize network bandwidth usage.
  • Supports either 'application/qhal+json' (e.g. "userInfo.firstName") or 'application/json' (e.g. "UserInfo.FirstName") return types.
  • Authentication via ApiKey or Bearer Tokens
  • Business RefId context, when creating an instance of "QuiversDriver", you can specify a Business RefId to be used for all requests on that object.
  • Marketplace Id context, when creating an instance of "QuiversDriver", you can specify a Marketplace Id to be used for all requests on that object.
  • You can connect to all environments (internal, live, demo, test), and can run requests to different environments concurrently.
  • Batch Operations, you can specify an unlimited number of batch operations to be completed, of both GET and POST types. Once all operations are completed, a callback is triggered with details about how all the batch operations completed.

Author