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 🙏

© 2026 – Pkg Stats / Ryan Hefner

partybot-http-client

v0.0.1-beta-68

Published

Party Bot Http Client

Readme

##Organizations

var partybot = require('partybot-http-client');
// Get all
partybot.organisations.getAll(function(err, response, body) {
	
	if(response.statusCode == constants.SUCCESS) {
		console.log(response.statusCode);
		console.log(body);
	}
	else {
		console.log(err);
	}

});
// Get Organisation with id
partybot.organisations.getWithId('57f3a270f760e4f8ad97eec4', function(err, response, body) {
	
	console.log(response.statusCode);
	console.log(body);
	console.log(err);

});
// Create
partybot.organisations.create({name: "New organisation"}, function(err, response, body) {
	
	console.log(response.statusCode);
	console.log(body);
	console.log(err);

});
// Update With Id
partybot.organisations.updateWithId('57f48fa9a9fd7b00113ba6b8', {name: "Update Organisation Name"}, function(err, response, body) {
	
	console.log(response.statusCode);
	console.log(body);
	console.log(err);

});

##Venues

var organisationId = '57f3a270f760e4f8ad97eec4';

// Get All Venues in an Organisation
partybot.venues.getAllInOrganisation(organisationId, function(err, response, body) {
	
		console.log(response.statusCode);
		console.log(body);
		console.log(err);

});

var venueId = '57f380f17fb36ae92003647b';
// Get Venue with Organisation Id and Venue Id
partybot.venues.getWithOriganisationIdAndVenueId(organisationId, venueId, function(err, response, body) {
	
		console.log(response.statusCode);
		console.log(body);
		console.log(err);

});

// Get Venue directly
partybot.venues.getWithId(venueId, function(err, response, body) {
	
		console.log(response.statusCode);
		console.log(body);
		console.log(err);

});

// Create venue in a organisation
var createParams = {
	organisationId: organisationId,
	name: "Venue Name",
	description: "Venue description",
	image: "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
};

partybot.venues.create(params, function(err, response, body) {
	
	console.log(response.statusCode);
	console.log(body);
	console.log(err);

});

// Update Venue with Organisation Id and Venue Id

// Update Venue with Venue Id
organisationId = '57f3a270f760e4f8ad97eec4';
venueId = '57ff62f710b78b00117ee63a';
var updateParams = {
	organisationId: organisationId,
	venueId: venueId,
	name: "Venue Name",
	description: "Venue description",
	image: "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
};

partybot.venues.updateWithOrganisationIdAndVenueId(updateParams, function(err, response, body) {
	cl("Error: " +JSON.stringify(err, null, 2));
	cl("Response : " +response.statusCode || null);
	cl("Body: " +JSON.stringify(body, null, 2));
});

###Events


var organisationId = '57f3a270f760e4f8ad97eec4';
var venueId = '57f4681dbb6c3c23633eecc2';
var eventId = '57f4b1fda9fd7b00113ba6c8';

// Get All Events In Venue In Organisation
partybot.events.getAllEventsInVenueInOrganisation({organisationId: organisationId, venueId: venueId}, function(err, response, body) {
	console.log("Error: "+err);
	console.log("Status Code: "+response.statusCode);
	console.log("Body :"+JSON.stringify(body));
});

// Get Event In Venue In Organisation
partybot.events.getEventInVenueInOrganisation({organisationId: organisationId, venueId: venueId, eventId: eventId}, function(err, response, body) {
	console.log("Error: "+err);
	console.log("Status Code: "+response.statusCode);
	console.log("Body :"+JSON.stringify(body));
});
// Create Event

var createParams = {
		organisationId: organisationId,
		venueId: venueId,
		name: "Event",
		description: "Description of Event"
}

partybot.events.create(createParams, function(err, response, body) {
	console.log("Error: "+JSON.stringify(err));
	console.log("Status Code: "+response.statusCode);
	console.log("Body :"+JSON.stringify(body));
});

###Users

var organisationId =  "57f3a270f760e4f8ad97eec4";
var userId = "57fdade284cd6200113dbed1";
var createUser = {
	organisationId: organisationId,
	name: { first: "JC", last: "Velasquez" },
	username: "scasro",
	password: "1234",
	permissions: ["su"],
	image: "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
}

partybot.users.create(createUser, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

partybot.users.getAllInOrganisation({organisationId: organisationId}, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body, null, 2) || null);
});

All update parameters are optional except organisationId and userId. Just put the keys that you want to update.

var updateUser = {
	organisationId: organisationId,
	userId: userId,
	name: { first: "JC", last: "Velasquez" },
	username: "scasrzoo",
	password: "1234",
	permissions: ["su"],
	image: "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
};

partybot.users.update(updateUser, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

###Product

var organisationId =  "57f3a270f760e4f8ad97eec4";
var venueId = "57ff62f710b78b00117ee63a";
var createProduct = {
	"name": "product name",
	"description": "prod description",
	"price": 999.99,
	"image": "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
}

partybot.products.create(createProduct, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

Get All
var getAllParams = {
	organisationId: organisationId,
	venueId: venueId
};
partybot.products.getProducts(getAllParams, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

Get One
var productId = '57ff4e6c10b78b00117ee62d';
var getOneParams = {
	organisationId: organisationId,
	venueId: venueId,
	productId: productId
};
partybot.products.getProducts(getOneParams, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

// Update
var productId = '57ff4e6c10b78b00117ee62d';
var updateParams = {
	organisationId: organisationId,
	venueId: venueId,
	productId: productId,
	name: "product name",
	description: "prod description",
	price: 99999.99,
	// image: "https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/000/1f2/03a/1a0ed21.jpg"
};
partybot.products.update(updateParams, function(errors, response, body) {
	console.log("Errors: "+JSON.stringify(errors, null, 2) || null);
	console.log("Response status code: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body) || null);
});

###Promoter


var organisationId = '5800471acb97300011c68cf7';
var promoterId = '58049d4ec559fc001132654a';
var getAllParams = {
	organisationId: organisationId
};

partybot.promoters.getPromoters(getAllParams, function(err, response, body) {
	console.log("Error: "+err);
	console.log("Response: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body, null, 2) || null);
});

var getOne = Object.assign({promoterId}, getAllParams);
partybot.promoters.getPromoters(getOne, function(err, response, body) {
	console.log("Error: "+err);
	console.log("Response: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body, null, 2) || null);
});

var createParams = {
	organisationId: organisationId,
	name: { first: "Last", last: "Pogi" },
	image: "Imagelink",
}
partybot.promoters.create(createParams, function(err, response, body) {
	console.log("Error: "+err);
	console.log("Response: "+response.statusCode || null);
	console.log("Body: "+JSON.stringify(body, null, 2) || null);
});