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

@zoerai/integration

v0.0.8

Published

A TypeScript library built with tsdown

Readme

@zoerai/integration

A TypeScript library built with tsdown - fast, modern, and type-safe.

Features

  • Written in TypeScript with full type definitions
  • ESM module support
  • Built with tsdown for blazing fast builds
  • Comprehensive test coverage with Vitest
  • Zero dependencies

Installation

# Using npm
npm install @zoerai/integration

# Using pnpm
pnpm add @zoerai/integration

# Using yarn
yarn add @zoerai/integration

Usage

ESM (ES Modules)

import { greet, add, getVersion, upload } from '@zoerai/integration'

// Greet someone
const greeting = greet({ name: 'Alice' })
console.log(greeting) // "Hello, Alice."

// With enthusiasm
const enthusiasticGreeting = greet({ name: 'Bob', enthusiastic: true })
console.log(enthusiasticGreeting) // "Hello, Bob!"

// Add numbers
const sum = add(5, 3)
console.log(sum) // 8

// Get library version
const version = getVersion()
console.log(version) // "1.0.0"

// Upload a file
const file = {
  name: 'document.pdf',
  size: 2048,
  type: 'application/pdf'
}
const uploadResult = await upload.uploadFile(file)
console.log(uploadResult)
// { success: true, url: '...', fileId: '...', timestamp: ... }

Configuration

Environment Setup

The library automatically detects the environment and uses the appropriate API endpoint:

  • Production (default): https://zoer.ai/
  • Development: http://127.0.0.1:1011

configure(config)

Manually configure the library settings.

Parameters:

  • config.apiUrl? (string): Custom API base URL
  • config.environment? ('production' | 'development'): Set environment

Examples:

import { configure } from '@zoerai/integration'

// Set custom API URL
configure({ apiUrl: 'https://custom.api.com/' })

// Set environment (automatically uses the corresponding API URL)
configure({ environment: 'development' })

// Or both
configure({
  apiUrl: 'https://staging.zoer.ai/',
  environment: 'production'
})

getConfig()

Get the current configuration.

Returns: ApiConfig - Current configuration object

Example:

import { getConfig } from '@zoerai/integration'

const config = getConfig()
console.log(config.apiUrl)       // 'https://zoer.ai/'
console.log(config.environment)  // 'production'

getApiUrl()

Get the current API base URL.

Returns: string - Current API base URL

Example:

import { getApiUrl } from '@zoerai/integration'

const url = getApiUrl()
console.log(url)  // 'https://zoer.ai/'

API

greet(options)

Greets a person with a customizable message.

Parameters:

  • options.name (string): The name of the person to greet
  • options.enthusiastic (boolean, optional): Add enthusiasm to the greeting

Returns: string - The greeting message

Example:

greet({ name: 'Alice' }) // "Hello, Alice."
greet({ name: 'Bob', enthusiastic: true }) // "Hello, Bob!"

add(a, b)

Adds two numbers together.

Parameters:

  • a (number): First number
  • b (number): Second number

Returns: number - The sum of a and b

Example:

add(5, 3) // 8
add(-2, 10) // 8

getVersion()

Gets the current library version.

Returns: string - The version string

Example:

getVersion() // "1.0.0"

upload.uploadFile(file)

Upload a single file to the backend using multipart/form-data.

Parameters:

  • file (UploadFile): The file to upload
    • name (string): File name (e.g., "document.pdf", "image.png")
    • size (number): File size in bytes
    • type (string): MIME type (e.g., "image/png", "application/pdf")
    • data? (Buffer | Blob | ArrayBuffer): File content (optional)

Returns: Promise<UploadResult> - Upload result

  • success (boolean): Whether the upload was successful
  • url? (string): Uploaded file URL or path
  • fileId? (string): Uploaded file ID
  • error? (string): Error message if upload failed
  • timestamp (number): Upload timestamp

Example:

// Browser environment with File API
const fileInput = document.querySelector('input[type="file"]')
const browserFile = fileInput.files[0]

const uploadFile = {
  name: browserFile.name,
  size: browserFile.size,
  type: browserFile.type,
  data: await browserFile.arrayBuffer()
}

const result = await upload.uploadFile(uploadFile)
console.log(result)
// { success: true, url: '...', fileId: '...', timestamp: ... }

// Node.js environment
import fs from 'fs'

const buffer = fs.readFileSync('path/to/file.pdf')
const result = await upload.uploadFile({
  name: 'document.pdf',
  size: buffer.length,
  type: 'application/pdf',
  data: buffer
})

Development

Install dependencies

pnpm install

Build

# Build the library
pnpm build

# Watch mode for development
pnpm dev

Testing

# Run tests
pnpm test

# Watch mode for tests
pnpm test:watch

# Generate coverage report
pnpm test:coverage

# Open test UI
pnpm test:ui

Built With

  • TypeScript - Type-safe JavaScript
  • tsdown - The elegant bundler for libraries
  • Vitest - Next generation testing framework

License

ISC