Socket
Book a DemoInstallSign in
Socket

neopet-image-finder

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neopet-image-finder

A small module for finding Neopet image links.

latest
Source
npmnpm
Version
5.0.2
Version published
Maintainers
1
Created
Source

neopet-image-finder

Downloads Version Travis

neopet-image-finder is a very simple module that obtains the pet image links for a Neopet with a given size and mood, searchable by name. Usage is extremely simple:

const petImage = require('neopet-image-finder');

petImage('Pikachu53535').then(data => console.log(data)).catch(console.error);

The response would be similar to this:

{
	data: <Buffer>,
	url: 'http://pets.neopets.com/cp/jd68fd89/1/5.png'
}

It returns a promise, so you can await it as well. If the pet is not found, it returns null instead.

try {
	const data = await petImage('Pikachu53535');
	if (!data) return null;
	console.log(data.url);
} catch (err) {
	console.error(err);
}

There are also two options you can specify, size and mood.

petImage('Pikachu53535', { size: 2, mood: 4 }).then(data => console.log(data.url)).catch(console.error);

Sizes:

  • 50x50, Portrait
  • 150x150
  • 80x80
  • 300x300
  • 500x500 (Default)
  • 150x150, Portrait
  • 640x640

Moods:

  • Happy (Default)
  • Sad
  • Angry
  • Sick
  • No Mouth or Eyes

Both are entirely optional, and will simply default to 500x500 and Happy if not specified.

Keywords

neopet

FAQs

Package last updated on 10 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts