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

yoyolib

v5.0.1

Published

A lightweight Node.js toolkit: logging, i18n, profiler, config, cache, event bus, env loader, validate, schedule and utilities

Readme

YoyoLib v5.0.0

A lightweight, zero-dependency Node.js toolkit for production-grade applications. Built for performance and reliability without the bloat of external node_modules.


Navigation


Core Utilities

Logger V3

Leveled console/file logging with child loggers, JSON output, and automatic rotation.

const { createLogger } = require('yoyolib');
const logger = createLogger(false, true, { level: 'info', maxSize: 10 }); // rotate at 10MB

logger.info('Server started');
const authLogger = logger.child({ module: 'auth' });
authLogger.warn('Invalid login'); 

LangManager

JSON-based i18n support with fallback, pluralization, and dot-notation keys.

const { createLangManager } = require('yoyolib');
const lang = createLangManager(); // scan ./langs/*.json
lang.set('fr');
lang.use('welcome.message', { user: 'Alice' });

ConfigManager

Key/Value configuration store with deep-path support (get/set) and file persistence.

const { createConfigManager } = require('yoyolib');
const config = createConfigManager('settings.json', { debug: false });
config.set('database.port', 5432); // auto-saves

EnvLoader

Typed environment variables loader (.env + process.env).

const { createEnvLoader } = require('yoyolib');
const env = createEnvLoader();
const port = env.getNumber('PORT', 3000);
const debug = env.getBool('DEBUG', false);

Security & Privacy

Security (JWT & AES-256-GCM)

Native cryptographic utilities using authenticated encryption.

const { jwtUtils, cryptoUtils } = require('yoyolib');

// JWT (Native crypto implementation)
const token = jwtUtils.sign({ id: 42 }, 'secret', { expiresIn: '1h' });
const decoded = jwtUtils.verify(token, 'secret');

// AES-256-GCM (Authenticated Encryption)
const { encrypted, iv, tag } = cryptoUtils.encrypt('sensitive-data', '32-byte-key-placeholder-here-!!!');
const plain = cryptoUtils.decrypt(encrypted, '32-byte-key-placeholder-here-!!!', iv, tag);

DataMasker (GDPR)

Recursive object masker with circular reference protection and Whitelist/Blacklist modes.

const { createDataMasker } = require('yoyolib');
const masker = createDataMasker({
    fields: ['password', 'token'],
    customMaskers: {
        email: (val) => `${val[0]}***@${val.split('@')[1]}`
    }
});
const masked = masker.mask({ email: '[email protected]', password: '123' });

RateLimiter

Window-based throttling for API protection.

const { createRateLimiter } = require('yoyolib');
const limiter = createRateLimiter({ limit: 100, window: 60 }); // 100 req/min

const status = limiter.consume('user-ip-address');
if (!status.allowed) console.log(`Retry in ${status.resetIn}ms`);

Network & Resilience

Structured HTTP Client

Wrapper over native fetch with structured JSON handling, timeouts, and bearer auth.

const { httpClient } = require('yoyolib');
const data = await httpClient.get('https://api.com/data', { 
    timeout: 3000, 
    attempts: 3 
});

Circuit Breaker

Protects services from cascading failures by monitoring error rates.

const { CircuitBreaker } = require('yoyolib');
const breaker = new CircuitBreaker(myNetworkFn, { failureThreshold: 3 });
const result = await breaker.fire('param');

API Utils (Pagination)

Standard envelope for paginated API responses.

const { apiUtils } = require('yoyolib');
const response = apiUtils.paginate(items, totalCount, page, limit);
// Returns: { data: [...], metadata: { totalPages, currentPage, hasNext, ... } }

Monitoring & Lifecycle

HealthChecker

Aggregated status reporting for internal and external services.

const { createHealthChecker } = require('yoyolib');
const health = createHealthChecker();
health.register('db', async () => true);
const report = await health.getStatus(); // { status: "UP", services: { ... } }

ErrorReporter (Webhooks)

Automated crash notifications to Discord, Slack, or any custom webhook.

const { createErrorReporter } = require('yoyolib');
const reporter = createErrorReporter('https://webhook.url');

reporter.initGlobalHandler(); // Catch all uncaught exceptions
reporter.report(new Error('Manual report'), { severity: 'high' });

Profiler

Real-time system unit monitoring (CPU/RAM/Uptime) in the console.

const { createProfiler } = require('yoyolib');
const profiler = createProfiler();
profiler.enableProfiler(); // Stats display every 2s

ContextTracker (AsyncLocalStorage)

Propagate request context across the entire async call stack.

const { createContextTracker } = require('yoyolib');
const tracker = createContextTracker();
tracker.run({ reqId: 'uuid' }, () => {
    const { reqId } = tracker.get();
});

Advanced Data & Tasks

Validator

Schema-based object validation with built-in rules.

const { validate } = require('yoyolib');
const schema = {
    username: { type: 'string', required: true, min: 3 },
    age: { type: 'number', min: 18 }
};
validate({ username: 'admin', age: 25 }, schema); // throws ValidationError if fails

JobQueue

Async task queue with concurrency control.

const { JobQueue } = require('yoyolib');
const queue = new JobQueue({ concurrency: 2 });
queue.push(async () => { ... });

Scheduler

Recurring task management.

const { createScheduler } = require('yoyolib');
const scheduler = createScheduler();
scheduler.every('cleanup', 3600, () => runCleanup()); // every hour

Data Manipulation (Flatten & Path)

const { ObjectFlatten, objectPath } = require('yoyolib');

// Flatten/Unflatten
const flat = ObjectFlatten.flatten({ a: { b: 1 } }); // { "a.b": 1 }
// Deep access
objectPath.get({ user: { id: 1 } }, 'user.id'); // 1

Aesthetics & Helpers

AnsiColors

Zero-dependency terminal styling.

const { ansiColors } = require('yoyolib');
console.log(ansiColors.bold(ansiColors.red('Critical Error!')));

objectUtils

Deep merge, clone, and object filtering.

const { objectUtils } = require('yoyolib');

const merged = objectUtils.deepMerge({ a: 1 }, { b: 2 });
const picked = objectUtils.pick({ a: 1, b: 2 }, ['a']); // { a: 1 }
const stripped = objectUtils.omit({ a: 1, b: 2 }, ['b']); // { a: 1 }

stringUtils

const { stringUtils } = require('yoyolib');
stringUtils.slugify('Hello World!'); // "hello-world"
stringUtils.camelCase('hello_world'); // "helloWorld"

Security & Permissions

This library requires Network Access for the following legitimate purposes:

  • httpClient: Making outgoing requests to external APIs.
  • ErrorReporter: Sending automated error notifications to your configured webhooks (Discord/Slack).

No data is sent anywhere else, and we collect zero analytics.


Stability & Requirements

  • Registry: 0 external dependencies.
  • Node.js: Requires version 18.0.0 or higher.
  • TypeScript: Included index.d.ts for full intellisense.
  • CI/CD: Fully tested suite (70+ unit tests) on Node 18, 20, 22.

License

YoyoLib Custom License