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

@nokori/js-sdk

v1.3.16

Published

nokori Node.JS js/ts sdk

Downloads

40

Readme

@nokori/js-sdk

Official JavaScript SDK for nokori.

nokori is the Programmable Intelligence platform providing the tools and infrastructure innovators need to move at the speed of imagination.

The basics

For a full run-down of the nokori platform, check out the documentation.

Table of Contents

Hubs Code Examples

Checkout basic Hubs code examples for popular JS frameworks:

Hubs Powered Components

nokori makes it near effortless to add any database or API operation to your components without servers, APIs, or infrastructure to manage.

Because nokori is cloud-native, Configure, test, and deploy your API & Database connections all in one place.

Basic Component Example

import nokori from '@nokori/js-sdk'
const nk = nokori('api_key')

async function create(formData: FormData){
 const { data, error } = await nk.query.execute({
    queryId: 'nk.q.-ddqHfqeZNihbChcAbf', //Global Cloud Query ID
      context: {
        name: formData.get('name')
      } 
    }
  )
}

export default function FormComponent() {
  return (
    <form action={create}>
      <input type="text" name="name" />
      <button type="submit">Submit</button>
    </form>
  )
}

Installation

npm i @nokori/js-sdk

Usage

Import and initialize the SDK.

import nokori from "@nokori/js-sdk";
const nk = new nokori('<<API_KEY>>')

Querying

Query a database after setting it up in the nokori App.

const {data, error} = await nk.query.execute({
  queryId: 'nk.q.-ddqHfqeZNihbChcAbf',
  context: {
    created_at: '2023-01-01',
  } 
})

nokori Mail

Application developers can leverage the power of nokori Mail to send transactional emails, newsletters, and more.

const {data, error} = await nk.query.mail({
  templateId: 'send-password-reset',
  settings: {
    to: '[email protected]',
  } 
})

Templates are easily managable within the nokori UI.

nokori AI

nokori AI is state of the art that is easy to use and simple to integrate.

We're helping organizations of all sizes integrate common data flows and usecases and rapidly turn them in to AI powered intelligence embeddable in any application.

Basic AI Example

As seen in our full docs, a common problem of current Large Language Models (LLM) is the tendency to 'hallucinate' or generate text that is not relevant to the prompt.

Using nokori Generate, you can leverage the results of Hubs Queries to generate text that is relevant to your data and create a more natural experience for your users with accurate information.

As shown above, lets assume this Special Purpose Cloud Function returns the sum of sales since the beginning of the year.

const { data: totalSales, error } = await nk.query.execute({
  queryId: 'nk.q.-ddqHfqeZNihbChcAbf',
  context: {
    created_at: '2022-01-01',
    status: 'active'
  } 
})

// totalSales = { value: 35933 }

Next, we can pass these results in generate to create a human-like response from this data for our users.

const { data, error } = await nk.ai.generate({
  prompt: "What are total sales since the beginning of the year?",
  context: [totalSales]
})

// "Total sales are $35,933.00 since Jan 1, 2022."

The same example could be leveraged for organizations that had a large document corpus in an ElasticSearch index, for example, allowing their existing ES queries to fetch relevant documents and then generate a human-like response to the user based on those docs.

Read the docs for more.

Classifiers

nokori offers cloud-native programmable text classifiers that are breathlessly easy to use. Incrementally trainable in the cloud, you can train a classifier instantly and skip the infrastructure and training data management.

Create a classifier:

const { data, error } = await nk.classifiers.create({
  name: 'Hot Dog Classifier',
})

// classifierId: nk.clfr.******************

Incrementally train a classifier:

const { data, error } = await nk.classifiers.train({
  classifierId: 'nk.clfr.******************',
  label: 'hot dog',
  context: 'two buns with meat in the middle',
})

Predict with a classifier:

const { data, error } = await nk.classifiers.predict({
  classifierId: 'nk.clfr.******************',
  context: 'two buns with meat in the middle',
})

// label: 'hot dog'

Get all classifiers:

const { data, error } = await nk.classifiers.getMany()

Get one classifier:

const { data, error } = await nk.classifiers.getOne({
  classifierId: 'nk.clfr.******************',
})

Delete a classifier:

const { data, error } = await nk.classifiers.delete({
  classifierId,
})

Read the full Classifier docs for more.