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

nookipedia

v1.0.0

Published

An API wrapper for Nookiepedia.

Downloads

19

Readme

A simple wrapper for Nookipedia's API. When calling an endpoint (one of critter, villager, or fossil) for an entry, the result is always cached and will be returned for requests of the same entry from then on, until the cache expires. The data is cached into an extension of a Map with the key as the name from the API's response, when checking to see if an entry is cached, a string algorithm is used so things like accents shouldn't cause too much of a problem. For the critter endpoint, there is no data representing how long until the response is considered expired, so it's manually set that that data will be considered expired from 6 hours from the initial request.

All methods from the wrapper returns in the form of:

{
  valid: boolean;
  error: string | null;
  data: [data] | null;
}

valid determines if the call was successful and that the data property has the wanted data, if valid is false, then error represents the error that had occurred. The only exception is the today endpoint, which returns information as its received from the API.

Installation

npm install nookipedia

Documentation

The documentation can be viewed in the documentation directory.

Usage

The basic usage for endpoints looks like this

const { Nookipedia } = require("nookipedia");

// You can request an API key at Nookipedia's main api page:
// https://nookipedia.com/api/.
const api = new Nookipedia("[key]");

// Get the villager 'Freya' from the villager endpoint.
let freya = await api.villagers.get('freya');

// From then on, until the cache expires, a request for
// the villager 'Freya' will be the cached data.
freya = await api.villagers.get('freya'); // => cached data

// If, for whatever reason, you would like to get a response straight
// from the API and not cached data, which includes the other endpoints as well,
// pass a 'cache' property onto the options parameter with the value of 'false'.
freya = await api.villagers.get('freya', { cache: false }); // => data straight from the API.