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

@abdokouta/react-support

v2.1.0

Published

Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript

Readme


✨ Features

  • 🎯 Str Class - 100+ string manipulation methods matching Laravel's API
  • 📦 Collection - Array collection with 50+ chainable methods (powered by collect.js)
  • 🗺️ MapCollection - Map data structure with collection methods
  • 🎲 SetCollection - Set data structure with collection methods
  • 🏗️ BaseRegistry - Generic registry pattern for building extensible systems
  • 🎭 Facades - Laravel-style facades for clean service access
  • 💪 TypeScript - Full type safety with comprehensive type definitions
  • 🔗 Chainable - Fluent, chainable API for elegant code
  • 🚀 Zero Config - Works out of the box

📦 Installation

npm install @abdokouta/react-support
# or
pnpm add @abdokouta/react-support
# or
yarn add @abdokouta/react-support

🚀 Usage

Str Class

import { Str } from '@abdokouta/react-support';

// String manipulation
Str.camel('foo_bar'); // 'fooBar'
Str.snake('fooBar'); // 'foo_bar'
Str.kebab('fooBar'); // 'foo-bar'
Str.studly('foo_bar'); // 'FooBar'
Str.title('a nice title'); // 'A Nice Title'

// String inspection
Str.contains('This is my name', 'my'); // true
Str.startsWith('Hello World', 'Hello'); // true
Str.endsWith('Hello World', 'World'); // true
Str.isJson('{"key": "value"}'); // true
Str.isUrl('https://example.com'); // true
Str.isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de'); // true

// String extraction
Str.after('This is my name', 'This is'); // ' my name'
Str.before('This is my name', 'my'); // 'This is '
Str.between('This is my name', 'This', 'name'); // ' is my '

// String modification
Str.limit('The quick brown fox', 10); // 'The quick...'
Str.slug('Laravel 5 Framework', '-'); // 'laravel-5-framework'

// And 80+ more methods!

Collection (Array)

import { collect } from '@abdokouta/react-support';

// Create a collection
const collection = collect([1, 2, 3, 4, 5]);

// Chainable methods
collection
  .filter((item) => item > 2)
  .map((item) => item * 2)
  .sum(); // 24

// Working with objects
const users = collect([
  { name: 'John', age: 30 },
  { name: 'Jane', age: 25 },
  { name: 'Bob', age: 35 },
]);

users.where('age', '>', 25).pluck('name').all();
// ['John', 'Bob']

// Aggregation
collect([1, 2, 3, 4, 5]).sum(); // 15
collect([1, 2, 3, 4, 5]).avg(); // 3
collect([1, 2, 3, 4, 5]).max(); // 5
collect([1, 2, 3, 4, 5]).min(); // 1

Facades

import { Facade, createFacade } from '@abdokouta/react-support';
import { Container } from '@abdokouta/ts-container';

// Set the container for facades
Facade.setFacadeContainer(Container.getContainer());

// Create a facade for a service
const Config = createFacade<IConfigService>('ConfigService');

// Use the facade
Config.get('app.name');
Config.set('app.debug', true);

MapCollection

import { collectMap } from '@abdokouta/react-support';

const map = collectMap({ name: 'John', age: 30 });

map.set('city', 'New York');
map.get('name'); // 'John'
map.has('age'); // true
map.keys(); // ['name', 'age', 'city']
map.values(); // ['John', 30, 'New York']

SetCollection

import { collectSet } from '@abdokouta/react-support';

const set1 = collectSet([1, 2, 3]);
const set2 = collectSet([2, 3, 4]);

set1.union(set2).all(); // [1, 2, 3, 4]
set1.intersect(set2).all(); // [2, 3]
set1.diff(set2).all(); // [1]

BaseRegistry

import { BaseRegistry } from '@abdokouta/react-support';

// Create a typed registry
interface Theme {
  name: string;
  colors: Record<string, string>;
}

const themeRegistry = new BaseRegistry<Theme>({
  validateBeforeAdd: (key, theme) => {
    if (!theme.name) {
      return { valid: false, error: 'Theme must have a name' };
    }
    return { valid: true };
  },
  afterAdd: (key, theme) => {
    console.log(`Registered theme: ${theme.name}`);
  },
});

// Register items
themeRegistry.register('dark', { name: 'Dark', colors: { bg: '#000' } });
themeRegistry.register('light', { name: 'Light', colors: { bg: '#fff' } });

// Retrieve items
const theme = themeRegistry.get('dark');
const allThemes = themeRegistry.getAll();
const hasTheme = themeRegistry.has('dark');

📘 TypeScript Support

Full TypeScript support with comprehensive type definitions:

import {
  Str,
  Collection,
  MapCollection,
  SetCollection,
  BaseRegistry,
} from '@abdokouta/react-support';

// Type-safe collections
const numbers: Collection<number> = collect([1, 2, 3]);

// Type-safe maps
const userMap: MapCollection<string, User> = collectMap();

// Type-safe sets
const tags: SetCollection<string> = collectSet(['tag1', 'tag2']);

// Type-safe registries
const registry = new BaseRegistry<MyType>();

📄 License

MIT

🙏 Credits