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

@surgbc/egw-writings-shared

v1.0.0

Published

Shared utilities, types, and database schema for EGW Writings MCP servers

Readme

@surgbc/egw-writings-shared

Shared utilities, types, and database schema for EGW Writings MCP servers for educational and research purposes.

Overview

This package provides common functionality shared across the EGW Writings MCP server ecosystem, including API client utilities, database management, type definitions, and authentication handling.

Features

  • API Client: OAuth-enabled HTTP client for EGW Writings API
  • Database Management: SQLite database with FTS5 full-text search
  • Type Definitions: Complete TypeScript types for all API responses
  • Authentication: OAuth 2.0 client credentials flow with token management
  • Utilities: Common helper functions and configurations

Installation

npm install @surgbc/egw-writings-shared

Usage

API Client

import { createAuthManager, createApiClient } from '@surgbc/egw-writings-shared';

const authManager = createAuthManager();
const apiClient = createApiClient(authManager);

// Search writings
const results = await apiClient.search('righteousness by faith', {
  lang: ['en'],
  limit: 10
});

// Get languages
const languages = await apiClient.getLanguages();

// Get books
const books = await apiClient.getBooksByFolder(folderId);

Database Management

import { EGWDatabase } from '@surgbc/egw-writings-shared';

const db = new EGWDatabase({
  dbPath: './data/egw-writings.db',
  enableFTS: true,
  enableWAL: true
});

// Insert data
db.insertLanguage('en', 'English', 'ltr');
db.insertBook(bookData);
db.insertParagraph(paragraphData, bookId, chapterTitle);

// Search
const results = db.search('righteousness by faith', 10, 0);
const count = db.searchCount('righteousness by faith');

// Get statistics
const stats = db.getStats();

Types

import type { 
  Book, 
  Paragraph, 
  SearchResult, 
  Language,
  Folder 
} from '@surgbc/egw-writings-shared';

// Use types for type safety
const processBook = (book: Book) => {
  console.log(`${book.title} by ${book.author}`);
};

Environment Variables

The shared package looks for these environment variables:

EGW_CLIENT_ID=your_client_id
EGW_CLIENT_SECRET=your_client_secret
EGW_TOKEN_FILE=./egw-token.json  # Optional: custom token storage location

Database Schema

The package creates and manages these tables:

  • languages: Language codes and metadata
  • folders: Hierarchical organization structure
  • books: Complete book metadata and files
  • paragraphs: Full content with reference codes
  • paragraphs_fts: FTS5 virtual table for search
  • download_progress: Progress tracking for bulk operations

API Coverage

Supports all major EGW Writings API endpoints:

  • Authentication (OAuth 2.0)
  • Language management
  • Folder/category browsing
  • Book discovery and metadata
  • Content retrieval (chapters, paragraphs)
  • Search functionality
  • Suggestions and autocomplete

Educational and Research Use

This package is designed for educational and research purposes. The EGW writings may be subject to copyright restrictions. Users are responsible for ensuring their use complies with applicable copyright laws and fair use guidelines.

Organization

Developed by Gospel Sounders under the leadership of Brian Onang'o.

License

UNLICENSED - Proprietary software for educational and research use.

Support