# slothpixel

> A simplified interface for the Slothpixel API.

Latest version **1.2.1** (published 2020-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install slothpixel
pnpm add slothpixel
yarn add slothpixel
bun add slothpixel
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2020-06-10 |
| First published | 2020-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Richie Bendall |
| Maintainers | richienb |
| Keywords | hypixel, slothpixel, minecraft, api, wrapper, request |

## Links

- npm: https://www.npmjs.com/package/slothpixel
- Repository: https://github.com/Richienb/slothpixel
- npm.io page: https://npm.io/package/slothpixel

## Dependencies (3)

- [ky](https://npm.io/package/ky.md) ^0.20.0
- [ky-universal](https://npm.io/package/ky-universal.md) ^0.6.0
- [aggregate-error](https://npm.io/package/aggregate-error.md) ^3.0.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2020-06-10
- 1.2.0 — 2020-04-22
- 1.1.1 — 2020-04-10
- 1.0.0 — 2020-04-08

## README

# slothpixel [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/slothpixel/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/slothpixel)

A simplified interface for the Slothpixel API.

[![NPM Badge](https://nodei.co/npm/slothpixel.png)](https://npmjs.com/package/slothpixel)

## Install

```sh
npm install slothpixel
```

## Usage

```js
const slothpixel = require("slothpixel");

(async () => {
	const { uuid } = await slothpixel("players/Richienb");

	console.log(uuid);
	//=> "56da43a4088d4a7682b6dd431535015e"
})();
```

## API

### slothpixel(endpoint, options?)

#### endpoint

Type: `string`

The [API endpoint](https://docs.slothpixel.me) to call.

#### options

Type: `object`

The options to pass to the API.

### slothpixel.graphql(data)

Send a request to the Slothpixel Graphql API.

#### data

Type: `object`

The Graphql data to send. See https://graphql.org/learn/serving-over-http/#post-request.

```js
const slothpixel = require("slothpixel");

(async () => {
	const query = `{
		players {
			player(player_name: "Richienb") {
				uuid
			}
		}
	}`;

	const data = await slothpixel.graphql({ query });

	console.log(data.players.player.uuid)
	//=> "56da43a4088d4a7682b6dd431535015e"
})();
```

### slothpixel.SlothpixelError

Exposed for instanceof checks. This type of error is thrown when the API returns an error.

---
_Source: https://npm.io/package/slothpixel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
