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

encly

v1.5.6

Published

Create Enka Network Card with Canvas

Downloads

32

Readme

Encly

Create Enka Network Card with Canvas. This project is inspired by EnkaCard because I'm not proficient in Python, so I created its JavaScript version.

Installation

npm install encly

Usage/Examples

const Encly = require("encly");

const data = new Encly.Profile();

// get profile data
data
  .getProfile(uid)
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

const card = new Encly.Card();

// get link
card
  .getCard(id)
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

// for buffer result
card
  .getCardBuffer(id)
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

//get one card link
const card = new Encly.Card()
  .setCharacter(2) //set 1-8 in order of the character you have
  .setSplash("https://telegra.ph/file/f4f88905a8c0479818b9d.jpg"); //if you need custom splash art

card
  .getOneCard(857067560)
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

//for buffer result
card
  .getOneCardBuffer(857067560)
  .then((data) => {
    console.log(data);
  })
  .catch((err) => {
    console.log(err);
  });

Result/Example

  • getCard()
[
  {
    "name": "Barbara",
    "url": "https://telegra.ph/file/6d60f9d148549ce91aeb3.png"
  },
  {
    "name": "Nahida",
    "url": "https://telegra.ph/file/403b204e677e9660f9dac.png"
  },
  {
    "name": "Klee",
    "url": "https://telegra.ph/file/57d5f480836b8641c12a2.png"
  },
  {
    "name": "Qiqi",
    "url": "https://telegra.ph/file/674ee9a5b3f8e320707bc.png"
  },
  {
    "name": "Yaoyao",
    "url": "https://telegra.ph/file/5fa31d7c2e67a9e680201.png"
  },
  {
    "name": "Diona",
    "url": "https://telegra.ph/file/c07d1863f8a33f525c1f3.png"
  },
  {
    "name": "Sayu",
    "url": "https://telegra.ph/file/0f2bf762a0d31360179d7.png"
  },
  {
    "name": "Dori",
    "url": "https://telegra.ph/file/66cb08d8a1ede22f55729.png"
  }
]
  • getCardBuffer()
[
  {
    "name": "Barbara",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Nahida",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Klee",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Qiqi",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Yaoyao",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Diona",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Sayu",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  },
  {
    "name": "Dori",
    "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
  }
]
  • getOneCard()
{
  "name": "Nahida",
  "url": "https://telegra.ph/file/f664db2e59c4aac66c9d3.png"
}
  • getOneCardBuffer()
{
  "name": "Nahida",
  "buffer": "<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 07 44 00 00 03 e5 08 06 00 00 00 f2 80 5e e7 00 00 00 06 62 4b 47 44 00 ff 00 ff 00 ff a0 bd a7 ...>"
}
  • getProfile()
{
  "nickname": "Cly",
  "signature": "Malas",
  "level": 58,
  "worldLevel": 8,
  "nameCard": {
    "id": 210119,
    "name": "Yelan: Throw",
    "icon": "https://enka.network/ui/UI_NameCardIcon_Yelan.png",
    "banner": "https://enka.network/ui/UI_NameCardPic_Yelan_P.png",
    "navbar": "https://enka.network/ui/UI_NameCardPic_Yelan_Alpha.png"
  },
  "achievements": 741,
  "abyssFloor": 12,
  "abyssLevel": 3,
  "charactersPreview": [
    {
      "id": 10000014,
      "name": "Barbara",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Barbara.png",
      "level": 80
    },
    {
      "id": 10000073,
      "name": "Nahida",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Nahida.png",
      "level": 90
    },
    {
      "id": 10000029,
      "name": "Klee",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Klee.png",
      "level": 90
    },
    {
      "id": 10000035,
      "name": "Qiqi",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Qiqi.png",
      "level": 1
    },
    {
      "id": 10000077,
      "name": "Yaoyao",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Yaoyao.png",
      "level": 59
    },
    {
      "id": 10000039,
      "name": "Diona",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Diona.png",
      "level": 40
    },
    {
      "id": 10000053,
      "name": "Sayu",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Sayu.png",
      "level": 20
    },
    {
      "id": 10000068,
      "name": "Dori",
      "icon": "https://enka.network/ui/UI_AvatarIcon_Dori.png",
      "level": 1
    }
  ],
  "nameCardsPreview": [],
  "profilePicture": {
    "id": 10000029,
    "name": "Klee",
    "icon": "https://enka.network/ui/UI_AvatarIcon_Klee.png"
  }
}

Credit:

  • Assets are taken from the repository EnkaCard.