https://github.com/mrtomatolegit/crafatar-js
URL constructor for crafatar.com
https://github.com/mrtomatolegit/crafatar-js
crafatar minecraft
Last synced: 7 months ago
JSON representation
URL constructor for crafatar.com
- Host: GitHub
- URL: https://github.com/mrtomatolegit/crafatar-js
- Owner: mrTomatolegit
- Created: 2021-01-15T22:23:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-16T13:11:16.000Z (over 4 years ago)
- Last Synced: 2025-03-01T11:05:57.169Z (7 months ago)
- Topics: crafatar, minecraft
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/crafatar
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crafatar-JS
npm crafatar is a simple to use URL constructor for crafatar.com## Construct URLS
```js
const Crafatar = require("crafatar")// Get the face of a player's skin
Crafatar.getAvatar("4f2e2e779461440abdd597be814952ae")// Get the 3D Rendered model of a player's head
Crafatar.getHead("4f2e2e779461440abdd597be814952ae")// Get the 3D Rendered model of a player's full body
Crafatar.getBody("4f2e2e779461440abdd597be814952ae")// Get the player's skin
Crafatar.getSkin("4f2e2e779461440abdd597be814952ae")// Get the player's cape
Crafatar.getCape("4f2e2e779461440abdd597be814952ae")
```## Download the image files
```js
const fs = require("fs")const headURL = Crafatar.getHead("4f2e2e779461440abdd597be814952ae")
Crafatar.download(headURL).then((buff) => {
fs.writeFileSync("./crafatar3DHead.png", buff)
})
```