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

wunderlist

v0.1.3

Published

The Wunderlist JS SDK simplifies interacting with the Wunderlist API. It can be used both in the browser and on the server side.

Downloads

285

Readme

Wunderlist Javascript SDK

The Wunderlist JS SDK simplifies interacting with the Wunderlist API. It can be used both in the browser and on the server side.

Note: Before you can start using Wunderlist API you need to register your app.

Basic Usage

Node

var WunderlistSDK = require('wunderlist');
var wunderlistAPI = new WunderlistSDK({
  'accessToken': 'a user access_token',
  'clientID': 'your client_id'
});

wunderlistAPI.http.lists.all()
  .done(function (lists) {
    /* do stuff */
  })
  .fail(function () {
    console.error('there was a problem');
  });

Browser

Include the SDK somewhere:

<head>
  <script type="text/javascript" src="/dist/wunderlist.sdk.js"></script>
</head>

... it can be now loaded from a global namespace ...

var WunderlistSDK = window.wunderlist.sdk;

... or as an AMD module (if an AMD loader was present before the sdk was loaded) ...

define(['wunderlist.sdk'], function (WunderlistSDK) {
  // do stuff with wunderlist by getting an instance of the sdk through WunderlistSDK#start
});

Get an instance of the SDK:

// Returns an instance of the Wunderlist SDK setup with the correct client ID and user access token
// and sets up a single WebSocket connection for REST over socket proxying
var WunderlistAPI = new WunderlistSDK({
  'accessToken': 'a user token',
  'clientID': 'your application id'
});

WunderlistAPI.initialized.done(function () {
  // Where handleListData and handleError are functions
  // 'http' here can be replaced with 'socket' to use a WebSocket connection for all requests
  WunderlistAPI.http.lists.all()
    // handleListData will be called with the object parsed from the response JSON
    .done(handleListData)
    // handleError will be called with the error/event
    .fail(handleError);
});

Advanced Usage

All the available API services are exposed on the wunderlist.sdk constructor as services. This allows creating an instance of a single service rather than all services for the entire API.

'use strict';

var sdk = require('wunderlist');
var oauthConfig = require('../../config/oauth.json');

sdk.prototype.setupLogging({
  'logLevel': 'error',
  'logPattern': '*'
});

function getService (context, service) {

  var options = {
    'accessToken': context.session.access_token,
    'clientID': oauthConfig.clientId,
    'maxHttpRequests': 1000,
    'checkHealth': false
  };

  return new sdk.services[service]({
    'config': options
  });
}

module.exports = {
  'get': getService
};

Documentation

Open /docs/index.html in your browser for the full JS documentation, or from the /docs path if you are running the development server.

Development

The Wunderlist Javascript SDK is built with Wunderbits, lo-dash, node.js, grunt and some other stuff

Get started

If you are on a vanilla system, you need some tools

  • Install brew from http://mxcl.github.io/homebrew/
  • Install node/npm from http://nodejs.org/

Make yourself owner of /usr/local:

$ sudo chown -R whoami:staff /usr/local

One time setup:

$ make install

Clone the repo & start developing

$ git clone [email protected]:wunderlist/wunderlist.js.git
$ cd wunderlist.js
$ make start

Run tests

Run development server

$ make start

This will install all dependencies (via npm) if needed and start the server. By default the server runs on port 5020. You can configure this by setting the PORT environment variable, via the command line (i.e. env PORT=1234 make start).

Run unit tests

$ make unit

Watch unit tests (for development)

$ make watch

Debug (with node-inspector)

$ make debug

Run benchmark tests

$ make benchmarks

Run specific tests in node (run mocha directly)

$ ./node_modules/mocha/bin/_mocha --require specs/helper.js --grep "SchemaValidator" --watch --reporter spec specs/**/*.spec.js

Run specific tests in the browser

just click on a suite to use that as the grep pattern

Resources

Build documentation

$ make documentation