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

alpacabase-js

v0.1.0

Published

The official JavaScript client for AlpacaBase — Postgres, Auth, Storage, and Realtime.

Readme

@alpacabase/js

The official JavaScript/TypeScript client for AlpacaBase.

Install

npm install @alpacabase/js
# or
yarn add @alpacabase/js
# or
pnpm add @alpacabase/js

Quick Start

import { createClient } from '@alpacabase/js'

const alp = createClient(
  'https://your-project.alpaca-cloud.com',
  'your-anon-key'
)

Database

// Fetch rows
const { data, error } = await alp
  .from('posts')
  .select('id, title, author(name)')
  .eq('published', true)
  .order('created_at', { ascending: false })
  .limit(10)

// Insert
const { data } = await alp
  .from('posts')
  .insert({ title: 'Hello World', published: false })

// Update
await alp.from('posts').update({ published: true }).eq('id', 123)

// Delete
await alp.from('posts').delete().eq('id', 123)

// Single row
const { data: post } = await alp
  .from('posts')
  .select('*')
  .eq('id', 1)
  .single()

// Count
const { count } = await alp
  .from('posts')
  .select('*', { count: 'exact' })
  .eq('published', true)
  .count()

Auth

// Sign up
const { data, error } = await alp.auth.signUp({
  email: '[email protected]',
  password: 'supersecret',
})

// Sign in
const { data, error } = await alp.auth.signInWithPassword({
  email: '[email protected]',
  password: 'supersecret',
})

// OAuth (Google, GitHub, Discord...)
await alp.auth.signInWithOAuth({ provider: 'github' })

// Magic link
await alp.auth.signInWithOTP({ email: '[email protected]' })

// Get current user
const { data: { user } } = await alp.auth.getUser()

// Listen for auth changes
alp.auth.onAuthStateChange((event, session) => {
  console.log(event, session?.user?.email)
})

// Sign out
await alp.auth.signOut()

Storage

// Upload a file
const { data, error } = await alp
  .storage
  .from('avatars')
  .upload('user-123.png', file, { contentType: 'image/png' })

// Get a public URL
const { data: { publicUrl } } = alp
  .storage
  .from('avatars')
  .getPublicUrl('user-123.png')

// Download
const { data: blob } = await alp.storage.from('avatars').download('user-123.png')

// List files
const { data: files } = await alp.storage.from('avatars').list('users/')

// Delete
await alp.storage.from('avatars').remove(['user-123.png'])

// Signed URL (private files)
const { data: { signedUrl } } = await alp
  .storage.from('private').createSignedUrl('report.pdf', 60) // 60 seconds

// Create a bucket
await alp.storage.createBucket('avatars', { public: true })

Realtime

// Subscribe to database changes
const channel = alp
  .realtime
  .channel('db-changes')
  .on('postgres_changes', { schema: 'public', table: 'messages', eventType: '*' }, (payload) => {
    console.log('Change:', payload.eventType, payload.new)
  })
  .subscribe()

// Broadcast (pub/sub between clients)
const room = alp.realtime.channel('room:general')

room.on('broadcast', { event: 'cursor' }, (msg) => {
  console.log('Cursor moved:', msg.payload)
})
room.subscribe()

room.send({ type: 'broadcast', event: 'cursor', payload: { x: 100, y: 200 } })

// Presence (who's online)
room.on('presence', { event: 'sync' }, ({ currentPresences }) => {
  console.log('Online users:', currentPresences)
})
room.track({ userId: 'abc', name: 'Mel' })

// Cleanup
await alp.realtime.removeChannel(channel)

TypeScript

Fully typed. Pass your row type as a generic:

interface Post { id: number; title: string; published: boolean }

const { data } = await alp.from<Post>('posts').select('*')
// data is Post[] | null

Made with 🦙 by the AlpacaBase team.