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

akasha-system.js

v0.3.0

Published

API wrapper for akasha.cv

Downloads

85

Readme

AkashaSystem.js · NPM Version NPM Downloads npm package minimized gzipped size GitHub License Static Badge

Unofficial API Wrapper for akasha.cv

Usage

Installation

npm i akasha.js
yarn add akasha.js
pnpm i akasha.js

Example

import Akasha from 'akasha.js'

const akasha = new Akasha()
const calcs = await akasha.getCalculationsForUser('uuid')
const ranking =
    (calcs.data[0].calculations.fit.ranking /
        calcs.data[0].calculations.fit.outOf) *
    100
const name = calcs.data[0].name

console.log(`${name}: ${ranking.toFixed(2)}%`)

API Documentation

The API is documented using the OpenAPI Specification. The contract file is automatically generated from a HAR file obtained by loading the various endpoints on akasha.cv.

The documentation can be viewed on swagger.io

NOTE:

  • The method used to capture API calls doesn't reflect the full scope of endpoints on akasha.cv. This decision was made due to my narrow use case. If you've discovered an endpoint not covered in the contract, please open an issue specifying what it is and I can look into supporting it. Please keep in mind that any endpoints containing data that can be found on Enka.network and/or interact with it are intentionally excluded.
  • The automated generation of the contract isn't perfect. If you find a discrepency between the expected type and what it actually contains, please open an issue to notify me.
  • Akasha.cv's API isn't intended for public use and can change at any time. The script pnpm run validate can detect unexpected changes between the repo's contract and a newly generated one. pnpm run gen will genereate an updated contract & typings.
  • Other's are more then welcome to use the generated API contract in this repo for their own purposes, such as a wrapper in another language. Please keep in mind that it can quickly become out of date is you choose to copy it.

Project Structure

Scripts

pnpm run gen:openapi # generate the OpenAPI contract from a HAR file (named akasha_profile.har)
pnpm run gen:types   # generate TS types from the json contract and export them to src/schema.ts
pnpm run gen         # runs gen:openapi -> gen:types
pnpm run validate    # validates the current schema against an updated HAR file