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 🙏

© 2026 – Pkg Stats / Ryan Hefner

klasifikasi-js

v0.0.5

Published

Official Klasifikasi API Library

Readme

Klasifikasi for Node.js

Official Klasifikasi API Client Library

Requirement

Node v12 or later

Installation

npm install klasifikasi-js

Quick start

You will need valid clientId & clientSecret of your model. You can get those from credential section at your model page, which is both unique per model.

import Klasifikasi from "klasifikasi-js";

await Klasifikasi.build({
  creds: [
    {
      clientId: "client-id",
      clientSecret: "client-secret",
    },
  ],
});

You can pass multiple clientId & clientSecret too

import Klasifikasi from "klasifikasi-js";

await Klasifikasi.build({
  creds: [
    {
      clientId: "client-id-1",
      clientSecret: "client-secret-1",
    },
    {
      clientId: "client-id-2",
      clientSecret: "client-secret-2",
    },
  ],
});

Classify

You will need your model publicId to start classifying with your model. You can get your model publicId from you model page, or you can get it from here :

const models = Klasifikasi.getModels();
console.log(models);
/*
the output should be like this
  {
    [publicId: string]: {
      name: string,
      credential: {
        clientId: string,
        clientSecret: string,
        token: string,
        expiredAt: number
      },
      tags: {
        name: string,
        description: string | null,
        descriptionWeight: string | null
      }[]
    }
  }
*/

classifying example

const result = await Klasifikasi.classify("publicId", "query");
console.log(result);
/*
the output should be like this
  {
    result: {
      label: string,
      score: number
    }[]
  }
*/

or with dynamic tags

const result = await Klasifikasi.zslClassify(
  "publicId",
  "query",
  ["tag1", "tag2", "etc"],
  multiClass
);
console.log(result);
/*
the output should be like this
  {
    result: {
      label: string,
      score: number
    }[]
  }
*/

QaModel find

const result = await Klasifikasi.qamodelFind('Cara logging di javascript bagaimana ?', 'Cara logging pada javascript adalah console.log()')
console.log(result)
/** The output should be like this
    [
      {
        answer: string,
        context: string,
        end: number,
        score: number,
        start: number
      }
    ] */

QaModel bulk find

const result = await Klasifikasi.qamodelBulkFind([
      {
        question: 'Kapan indonesia merdeka?',
        context: 'Indonesia merdeka pada tanggal 17 Agustus 1945'
      },
      {
        question: 'Hai ini rakyat indonesia memperingati hari kemerdekaan mereka yang ke berapa?',
        context: 'Bulan ini, rakyat Indonesia akan memperingati hari kemerdekaan mereka yang ke 70 pada tanggal 17 Agustus'
      }
    ])
console.log(result)
/** The output should be like this
{
  result: [
    {
      answer: {
        answer: string,
        end: number,
        score: number,
        start: number
      },
      context: string,
      question: string,
    },
    ...
  ]
} */

Logs

You can get your classifying logs based on your model publicId

const logs = Klasifikasi.logs("publicId", {
  startedAt: new Date("1 December 2020"),
  endedAt: new Date("2 December 2020"),
  take: 100,
  skip: 0,
});
console.log(logs);
/*
the output should be like this
 {
   histories: {
     createdAt: Date,
     updatedAt: Date,
     deletedAt: Date,
     id: number,
     model: string,
     modelResult: {
       label: string,
       score: number
     }[]
     modelCurrentName: string,
     ipInfo: {
       ip: string
     },
     userId: number,
     aiModelId: number,
   }[],
   length: number
 }
*/

endedAt & startedAt parameter is mandatory, the rest is optional.

Error

All the function above will throw an error if something bad happen. The error object will have the same structure.

{
  status?: number // http status codes,
  body: {
    error: string
  }
}