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

thecity-admin-client

v0.0.1

Published

Provides a node client for The City's admin api.

Readme

#The City API Client This node module provides a client for The City's admin api.

##Installation ####npm npm install --save thecity-client ####old-fashion Download/clone, unzip into project

##Usage The client provides one method, call(), that handles all requests sent to The City. Rather than hard code each method that the city supports, it's up to the user to call the appropriate endpoint, method, and appropriate data. This allows maximum flexibility for the api, and ensures that any future method changes made by The City get immediate support via this client.

####Parameters:

  • endpoint The City api endpoint to call (see The City's docs for options)
  • method (optional, defaults to GET) Should be one of GET, PUT, POST, or DELETE
  • data (optional) The object to pass for PUT & POST requests

####Returns call() returns a promise that will call .then(success, failure) upon completion.

##Examples

var apikey = 'YOURAPIKEY'
  , usertoken = 'YOURUSERTOKEN'
  , client = require('thecity-admin-client');
  , api = new client(apikey, usertoken);

// Load all users.
api.call('users').then(function(res) {
  console.log('users', res.body); // contains the full response body from the city.
  console.log('code', res.code); // the response code from the city.
  console.log('throttle', res.throttle); // contains throttle info (limit/remaining).
});

// Load als groups (page 2).
api.call('groups?page=2').then(function(res) {
  console.log('users', res.body); // contains the full response body from the city.
  console.log('code', res.code); // the response code from the city.
  console.log('throttle', res.throttle); // contains throttle info (limit/remaining).
});

// Load a single user.
api.call('users/1234').then(function(res) {
  console.log('user', res.body);
});

// Update a user.
var user = {}; // Probably loaded from the city
api.call('users/1234', 'PUT', user).then(function(res) {
  console.log('code', res.code)
});

// This one failed.
// Load a single user.
api.call('users/1234').then(function(res) {
  console.log('user', res.body);
}, function(err) {
  console.log('oops!', err);
});

#License MIT

#Contribute? Bring it on! I'll toss some tests in eventually (feel free to do so as well)

#Thanks

  • Special thanks to the wonderful folks at The City for their hard work and decication.
  • The Journey Church for sponsoring this project.