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

api-node

v0.1.1

Published

Downloads

5

Readme

Ordr.in Node Library

About

A node library for the ordr.in API
See full API documantation at http://ordr.in/developers Also check out a working demo of all the api calls by running demo.js

Installation

The simplest way to install is with npm:

Usage

Initialization

Note that for the Urls https:// and the trailing / are all implied. DO NOT include them in the Url strings. The ordr.in API only supports https requests.

Callbacks

Because node is async every function call you make to the ordrin api includes a callback. This will be called when the api has finished your request. The format of this callback is always the same.
It takes two parameters: error and data.
If there's no error than error will be false, otherwise it will be an object.
Data is an object containing the data returned from the ordr.in api as described in the API documentation located at http://ordr.in/developers.

Example function callback:

Data Structures

The following classes are part of the library and are used whenever you need to pass an address, credit card, user, tray item, or tray to a library function.

You can create an object of one of these classes like so:

Validation

Each of the above Data Structers throw errors if you pass invalid values to their constructors. The errors are children of the javascript Error class, and include the additional property fieldErrors. This describes the different validation errors that occured. Example

User API

Order API

The Order API includes the ability to create a new user when you place the order. If you want to do that just pass in the new user's login credentials in the user object, and set createUser to true.

If you don't want the order to be associated with a user account then pass in false as the password inside the user object, and setCreateUser to false.