i18next is a mature, full-featured internationalization (i18n) library for JavaScript and TypeScript, used in production by thousands of projects across web (browser), Node.js, and Deno environments. It provides a complete translation pipeline: key-based lookup with namespaces, interpolation of variables ({{var}}), nesting of translations ($t(...)), pluralization via Intl.PluralRules (with ordinal support), context variants, and rich formatting (number, currency, datetime, relative time, list) using Intl APIs. The library is backend-agnostic: resources can be loaded synchronously or asynchronously from any source (files, HTTP, databases) via a plugin system, with built-in retry logic and parallel-read throttling. It also includes language detection, fallback chains, post-processing, and an event system for lifecycle hooks. The architecture is modular and event-driven. The core I18n class orchestrates initialization, plugin registration (via .use()), and delegates translation to the Translator. The Translator resolves keys using LanguageUtils (hierarchy/fallback), PluralResolver, and Interpolator, then looks up strings in the in-memory ResourceStore. The BackendConnector manages async loading from backends. The library exposes a selector API (keyFromSelector) that uses a revocable Proxy to collect property paths, enabling type-safe key construction in TypeScript. TypeScript support is extensive: users can augment CustomTypeOptions or ResourceNamespaceMap to get compile-time validation of translation keys, interpolation variables, and return types. Key entry points are the default instance (i18next.t(), i18next.init()) and factory methods (createInstance, getFixedT). The library has zero runtime dependencies; all external integrations (React, filesystem backends, language detectors) are separate packages. The codebase demonstrates high craftsmanship: performance-critical paths are optimized (caching of plural rules, language hierarchies, compiled regexps), security issues (ReDoS, prototype pollution, log injection) have been systematically addressed, and the type system is one of the most sophisticated in the JavaScript i18n ecosystem.
This repository is a mature, well-maintained Node.js library for building SQS-based applications without boilerplate. It provides a `Consumer` class that polls an AWS SQS queue, invokes user-defined message handlers (`handleMessage` or `handleMessageBatch`), and manages the full message lifecycle: receive, process, delete on success, and visibility timeout management. The architecture is a single class extending a typed `EventEmitter`, emitting events for lifecycle hooks (started, stopped, message_received, message_processed, error, etc.). Key entry points are `Consumer.create(options)`, `consumer.start()`, and `consumer.stop()`. The library supports both single and batch message processing, configurable polling intervals, heartbeat extensions for long-running handlers, graceful shutdown with in-flight message completion, and FIFO queue warnings. External dependencies are minimal: `@aws-sdk/client-sqs` for AWS SDK v3 and `debug` for logging. The codebase is written in TypeScript, fully tested with unit and integration tests, and follows semantic versioning with automated releases via semantic-release.
ifvisible.js is a modern, dependency-free browser library that provides a clean, event-driven API for detecting page visibility and user activity. It wraps the standard Page Visibility API to surface focus/blur events, and adds an idle-detection system that fires `idle`/`wakeup` events after a configurable period of user inactivity (mouse, keyboard, touch, scroll). Version 3 is a complete rewrite in TypeScript with per-instance event isolation, SSR-safe construction (no DOM access at import time), and support for the Page Lifecycle API (`freeze`/`resume` for bfcache). The library ships as an ESM module, CommonJS, and an IIFE global, with bundled type definitions. It is designed for use in any client-side JavaScript projectβSPA frameworks, traditional websites, or even server-side rendering environments (where it becomes a safe no-op). The architecture is simple: a single `IfVisible` class holds an internal `EventEmitter` and a `Timer` class for smart intervals that auto-pause when the user is idle. The codebase is well-structured, thoroughly tested (including an SSR test), and follows modern best practices. It is not a data research project; it is a reusable application library.
Tether is a JavaScript library for positioning UI elements relative to other elements, ensuring they remain attached during scroll, resize, and other interactions. It solves common UI positioning challenges for tooltips, dropdowns, popovers, and similar components through a modular architecture. The core Tether class utilizes plugins for constraint handling, abutment detection, and position shifting, built upon an evented base class for custom event management. The library demonstrates strong engineering practices with clear separation of concerns, comprehensive unit and integration tests (Jest and Cypress), and support for both UMD and ESM module formats. While the positioning logic inherently addresses complex browser edge cases, the codebase is well-structured and maintainable, evidenced by recent commits and a defined release process. Examples and documentation showcase real-world usage patterns. Two reusable components stand out: the evented utility (src/js/evented.js) implements a lightweight event emitter with on, once, off, and trigger methods, demonstrating the observer pattern for decoupled communication. The deferred utility (src/js/utils/deferred.js) provides a promise-like mechanism for asynchronous control flow with resolve, reject, and promise methods. Both modules are minimally coupled, depending only on a type-check utility, and embody proven patterns suitable for extraction into other projects.
nedb-promises is a lightweight Node.js library that wraps the @seald-io/nedb embedded database (a fork of nedb) with a promise-based API. It provides a Datastore class that extends EventEmitter, offering methods like find, insert, update, remove, and count that return Promises or thenable Cursor objects. The Cursor class supports fluent chaining (sort, skip, limit, project) and can be awaited directly. The library also includes MongoDB-compatible aliases (insertOne, updateMany, deleteOne, etc.) and a static `create()` method that returns a Proxy to access the underlying nedb instance's properties. The codebase is clean, well-tested, and leverages modern JavaScript features (async/await, Proxy, EventEmitter). It is a classic promise wrapper with a thoughtful event system for operation success and error broadcasting.
socketio-wildcard is a small Node.js library that adds a wildcard event listener ('*') to socket.io, allowing developers to catch all incoming events in a single handler. The core implementation is a middleware that intercepts the `onevent` method of a socket, emitting a wildcard event before delegating to the specific event handler. It supports both server-side and client-side usage, with a single-file module that exports a factory function. The library is deprecated as socket.io 2.0.4+ includes native middleware for packet interception, which supersedes the wildcard pattern. The codebase is clean, well-tested, and follows modern JavaScript standards, but its functionality is largely redundant with current socket.io features. The repository includes comprehensive integration tests using mocha and power-assert, and CI configurations for Travis and CircleCI.