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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jokio/sdk

v0.5.0

Published

pure js/ts sdk for building decentralised localfirst web apps. Provides tts ai model integrations, realtime p2p communication & crypto encryptions.

Readme

@jokio/sdk

npm version npm downloads npm license

SDK for building decentralised localfirst web apps. Provides authentication (guest, passkeys, email), tts ai model integrations, realtime communication & crypto encryptions.

Examples

Authentication

import { jok } from '@jokio/sdk'

// guest
{
  const userData = await jok.auth.guestLogin()
}

// passkeys
{
  // login with existing keys
  await jok.auth.requestPasskeyLogin()

  // login attempt with a specific displayName
  // acts like previous example if displayName not found
  await jok.auth.requestPasskeyLogin({ displayName })

  // registering a new passkey
  await jok.auth.requestPasskeyLogin({
    displayName,
    isRegistration: true,
  })
}

// email
{
  // 1. request otp code
  const isSent = await jok.auth.requestEmailLogin(email)

  // 2. complete process
  const userData = await jok.auth.completeEmailLogin(email, otpCode)
}

Text to speech (TTS)

import { jok } from '@jokio/sdk'

// get available voices
const voices = await jok.tts.getVoices()

console.log(voices)

// convert text to audio file
const audio = await jok.tts.getAudio(
  'Hello there, how are you?',
  'en-US-AvaNeural',
)

audio.play()

Real-time communication

Between users (browsers), using nats

import { jok } from '@jokio/sdk'

// Authentication should be done first

await jok.nats.connect()

await jok.nats.on('dev.test', (data, ctx) => {
  // in `ctx` you will receive caller's userId and sessionId
  console.log('Received event', data, ctx)
})

await jok.nats.publish('dev.test', {
  hello: 'world',
})

P2P encrypted message exchange

Works directly in browser

import { jok } from '@jokio/sdk'

const kp1 = await jok.crypto.createSessionKeyPair()
const kp2 = await jok.crypto.createSessionKeyPair()

const p1 = await jok.crypto.exportPublicKey(kp1.publicKey)
const p2 = await jok.crypto.exportPublicKey(kp2.publicKey)

console.log({ p1, p2 })

const shared1 = await jok.crypto.deriveAESKey(kp1.privateKey, p2)
const shared2 = await jok.crypto.deriveAESKey(kp2.privateKey, p1)

// `shared1` and `shared2` keys will be the same.

const originalText = 'Hello World'

const encrypted = await jok.crypto.encrypt(originalText, shared1)
const decrypted = await jok.crypto.decrypt(encrypted, shared2)

console.log({
  match: originalText === decrypted,
  originalText,
  decrypted,
})

Directly in HTML

You can use directly into html as well:

<script type="module">
  import { jok } from 'https://esm.run/@jokio/sdk'

  async function textToAudio() {
    const audio = await jok.tts.getAudio(
      'Hello there, how are you?',
      'en-US-AvaNeural',
    )

    audio.play()
  }

  window.textToAudio = textToAudio
</script>