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

surveymonkey

v1.1.0

Published

A node.js wrapper for the SurveyMonkey API.

Downloads

16

Readme

node-surveymonkey

A node.js library for the SurveyMonkey API

node-surveymonkey exposes the following features of the SurveyMonkey API to your node.js application:

  • SurveyMonkey API (Versions v3)

SurveyMonkey API (Version v2) has been hard deprecated. See https://help.surveymonkey.com/articles/en_US/kb/Transitioning-to-SurveyMonkey-s-v3-API

Further information on the SurveyMonkey API and its features is available at https://developer.surveymonkey.com

Installation

Installing using npm (node package manager):

npm install surveymonkey

If you don't have npm installed or don't want to use it:

cd ~/.node_libraries
git clone [email protected]:Datahero/node-surveymonkey.git

Please note that parts of node-surveymonkey depend on request by Mikeal Rogers. This library needs to be installed for the API to work. Additionally node-querystring is required. If you are using npm all dependencies should be automagically resolved for you.

Usage

Information on how to use the SurveyMonkey APIs can be found below. Further information on the API methods available can be found at https://developer.surveymonkey.com. You can also find further information on how to obtain an OAuth2 access token in your SurveyMonkey account and much more on the SurveyMonkey API pages.

SurveyMonkey API

SurveyMonkeyAPI takes two arguments.

  1. The first argument is your oAuth access token.
  2. The second argument is an options object which can contain the following options:
  • version The API version to use. Defaults to v3.
  • secure Whether or not to use secure connections over HTTPS (true/false). Defaults to false.
  • userAgent Custom User-Agent description to use in the request header.

The callback function for each API method gets two arguments. The first one is an error object which is null when no error occurred, the second one an object with all information retrieved as long as no error occurred.

Example:

var SurveyMonkeyAPI = require('surveymonkey').SurveyMonkeyAPI;

var accessToken = 'Your SurveyMonkey App Access Token';

try { 
    var api = new SurveyMonkeyAPI(accessToken, { version : 'v3', secure : false });
} catch (error) {
    console.log(error.message);
}

api.getSurveyList({}, function (error, data) {
    if (error)
        console.log(error.message);
    else
        console.log(JSON.stringify(data)); // Do something with your data!
});

// or with a survey id
api.getSurveyDetails({id:'113260729'},function (error, data) {
    if (error)
        console.log(error);
    else
        console.log(JSON.stringify(data)); // Do something with your data!
});

License

node-surveymonkey is licensed under the MIT License. (See LICENSE)