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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-winkdex

v0.1.0

Published

Node.js wrapper for the winkdex API

Readme

node-winkdex

A node.js library to consume the WinkDex API.

From the WinkDex website:

Winklevoss Index (also known as WinkDex) is a pioneering effort in the analysis and presentation of global bitcoin pricing and currently uses data from the most active qualified U.S. dollar denominated bitcoin exchanges.

Installation

To install:

npm install node-winkdex

Quick Start

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();

winkdex.price(function(err, price) {
  console.log(price); // prints current price
});

API

Initializing a winkdex

To get started, you first need to initialize a winkdex using:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();

When creating the winkdex, you can pass in some options, shown below:

| Option | Default Value | Description | | ------------- | ------------- | ---------------------------------------------------| | apiVersion | v0 | API version to use | | userAgent | node-winkdex | User Agent to send to API | | gzip | true | Whether to use Gzip encoding or not (recommended) |

For Example:

var winkdex = new WinkDex({
  apiVersion: 'v0',
  userAgent: 'your-app-name',
  gzip: true
});

apiVersion()

This function fetches and returns the current version of the API from the WinkDex API. Internally, it makes a call to the Winkdex /api endpoint and parses the location HTTP header. See API Versioning

Here is how you can use it:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();
winkdex.apiVersion(function(err, version) {
  console.log(version); // version is a string e.g. v0
});

price([time], callback)

This function fetches the current price. It takes one or two arguments.

If only one argument is passed, it assumes this argument is the callback and fetch the price at the current time.

If two arguments are passed, the first one must be the time at which we want price information for and a callback. This time should be a Javascript Date Object.

The callback is called with two arguments:

  • the first argument is an error object (or null if no error occurs).
  • the second argument is the price

To fetch current price:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();
winkdex.price(function(err, price) {
  console.log(price); // returns a number
});

To fetch the price at a specific time:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();

var timestamp = new Date(2014,1,1); // January 1, 2014

winkdex.price(timestamp, function(err, price) {
  console.log(price); // returns a number
});

series([start_time], [end_time], callback)

The series method allows you to get WinkDex time series data. You should use this if you want to plot the data or run some data analysis.

The method accepts 3 arguments:

  • a start time months
  • an end time
  • a callback function

The callback is called with two arguments:

  • the first argument is an error object (or null if no error occurs).
  • the second argument is the time series array

Note: You can call the series method with only the callback argument. In this case, it will default to returning the last 6 months of data.

To fetch the last 6 months of time-series data:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();

winkdex.series(function(err, series) {
  console.log(series); // prints array of prices
});

To get the time series for the month of January:

var WinkDex = require('node-winkdex');
var winkdex = new WinkDex();

var start = new Date(2014,1,1);
var end = new Date(2014,2,1);

winkdex.series(start, end, function(err, series) {
  console.log(series);
});

License

MIT