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

statisfy-browser

v1.0.7

Published

Get statistics from all of your favourite social media sites, games and more!

Downloads

6

Readme

logo npm npm bundle size npms.io (quality) npms.io (quality)  

Get statistics from all of your favourite social media sites, games and more!

 

Install

$ npm install statisfy

 

📖 Documentation

 

NPM

Functions

  • npm

 

CommonJS Usage

    const { npm } = require("statisfy");
    async function getNPM(pkg) => {
    const result = await npm(pkg); 
    console.log(result);
    }
    getNPM("statisfy") // your package here

 

ES6 Usage

    import { npm } from "statisfy";
     async function getNPM(pkg) => {
    const result = await npm(pkg); 
    console.log(result);
    }
    getNPM("statisfy") // your package here

 

Result

{
  name: 'statisfy',
  scope: 'unscoped',
  version: '1.0.2',
  description: 'Get statistics from all of your favourite social media sites, games and more!',
  keywords: [ 'stats', 'statistics', 'social', 'media', 'api' ],
  date: '2021-08-24T20:11:48.377Z',
  links: {
    npm: 'https://www.npmjs.com/package/statisfy',
    homepage: 'https://github.com/aspekts/statisfynpm#readme',
    repository: 'https://github.com/aspekts/statisfynpm',
    bugs: 'https://github.com/aspekts/statisfynpm/issues'
  },
  author: { name: 'Aspekts' },
  publisher: { username: 'aspekts', email: '[email protected]' },
  maintainers: [ { username: 'aspekts', email: '[email protected]' } ]
}

   

Twitch

 

Getting Client ID and Client Secret

Head to https://dev.twitch.tv/console and login with your twitch acccount.

From there you will find you will need to register a new application.

Inside the application you will see your Client ID.

You can generate a Client Secret by completing the captcha and selecting "New Secret".

 

Functions

  • getUserByName
  • getUserByID
  • getChannelInfo
  • searchChannels
  • getToken

 

CommonJS Example Usage

 

const { Twitch } = require("statisfy");
const ttv = new Twitch({
    client_id : "12345abcde", // your client id here
    client_secret: "67890fghij" // your client secret here
});
async function channelInfo() {
    const info = await ttv.getUserByName("Ludwig"); // your channel here
    console.log(info)
}
channelInfo()

 

ES6 Example Usage

 

import { Twitch } from "statisfy";
const ttv = new Twitch({
    client_id : "12345abcde", // your client id here
    client_secret: "67890fghij" // your client secret here
});
async function channelInfo() {
    const info = await ttv.getUserByName("Ludwig"); // your channel here
    console.log(info)
}
channelInfo()

 

Result

{
  id: '201761728',
  login: 'aspekts',
  display_name: 'Aspekts',
  type: '',
  broadcaster_type: '',
  description: "I'm Aspekts. A regular guy who has like no viewers or followers trying to have fun really. Follow if want, it's up to you honestly (PLEASE DO) ",
  profile_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b6fd40a-33c9-4a4b-a0c8-eb8169f836ae-profile_image-300x300.png',
  offline_image_url: 'https://static-cdn.jtvnw.net/jtv_user_pictures/65dcb42c-a22d-445d-a2bd-01e3e15ca510-channel_offline_image-1920x1080.jpeg',
  view_count: 188,
  created_at: '2018-03-03T18:01:17Z'
}

 

Twitter (ALPHA)

 

Functions

  • UserLookupByName

CommonJS Example Usage

const { Twitter } = require("statisfy");
const twt = new Twitter({
  token: "ABCD1234" // your bearer token here
})
async function twttest() {
    const result = await twt.UserLookupByName("POTUS")
    console.log(result)
}
twttest()

Result

{
  created_at: '2021-01-13T00:37:08.000Z',
  public_metrics: {
    followers_count: 13665857,
    following_count: 12,
    tweet_count: 1372,
    listed_count: 13037
  },
  protected: false,
  verified: true,
  url: 'https://t.co/IxLjEB2zlE',
  id: '1349149096909668363',
  description: '46th President of the United States, husband to @FLOTUS, proud dad & pop. Tweets may be archived: https://t.co/IURuMIrzxb',
  username: 'POTUS',
  entities: {
    url: { urls: [Array] },
    description: { urls: [Array], mentions: [Array] }
  },
  profile_image_url: 'https://pbs.twimg.com/profile_images/1380530524779859970/TfwVAbyX_normal.jpg',
  name: 'President Biden'
}

 

TRN (ALPHA)

 

Functions

  • Fortnite
  • Apex Legends  

CommonJS Example Usage

const { TRN } = require("statisfy");
const trn = new TRN({
  key:"ABC1234" // Tracker Network API Key
});
async function apextest() {
    const result = await trn.ApexLegends({
        username:'xAspekts',
        platform: "xbl"
    });
    console.log(result)
}
apextest() 
async function fntest(){
    const result = await trn.Fortnite({
        username:'Ninja',
        platform:'kbm'
    })
    console.log(result)
}
fntest()

 

Results - Apex Legends

 

{
  platformInfo: {
    platformSlug: 'xbl',
    platformUserId: 'xAspekts',
    platformUserHandle: 'xAspekts',
    platformUserIdentifier: 'xAspekts',
    avatarUrl: 'https://images-eds-ssl.xboxlive.com/image?url=wHwbXKif8cus8csoZ03RW8ke8ralOdP9BGd4wzwl0MJ9z6QzuGwZjtvbE7sSsMVW3GtqdB8tr2M604Js_A5hRb4ej1NAlLgfikoRUkt8XGoBbs9TId_M9.NIOpyumXn9la5RYDGV9y_fYQlPsMeH74.dFI.YBGHTHVD6_tFiUCo-',
    additionalParameters: null
  },
  userInfo: {
    userId: 4668724,
    isPremium: false,
    isVerified: false,
    isInfluencer: false,
    isPartner: false,
    countryCode: 'GB',
    customAvatarUrl: null,
    customHeroUrl: null,
    socialAccounts: [],
    pageviews: 6,
    isSuspicious: null
  },
  metadata: {
    currentSeason: 2,
    activeLegend: 'legend_13',
    activeLegendName: 'Loba',
    activeLegendStats: [ 'Season 8 Wins', 'Kills' ]
  },
  segments: [
    {
      type: 'overview',
      attributes: {},
      metadata: [Object],
      expiryDate: '2022-01-29T14:29:21.2766514+00:00',
      stats: [Object]
    },
    {
      type: 'legend',
      attributes: [Object],
      metadata: [Object],
      expiryDate: '2022-01-29T14:29:21.2766514+00:00',
      stats: [Object]
    },
    {
      type: 'legend',
      attributes: [Object],
      metadata: [Object],
      expiryDate: '2022-01-29T14:29:21.2766514+00:00',
      stats: [Object]
    }
  ],
  availableSegments: [ { type: 'legend', attributes: {}, metadata: {} } ],
  expiryDate: '2022-01-29T14:29:21.2766514+00:00'
}

Problems or issues?

If you encounter any problems, bugs or other issues with the package, please create an issue in the GitHub repo.

 

Contact

If you have any questions or just want to reach me, you can get in touch with me on my Discord server.