{"_id":"@abdokouta/react-support","_rev":"4-f3107cd55153a03bff5272536fc843ba","name":"@abdokouta/react-support","dist-tags":{"latest":"2.1.0"},"versions":{"1.1.0":{"name":"@abdokouta/react-support","version":"1.1.0","keywords":["laravel","string","collection","registry","utilities","str","map","set","typescript"],"author":{"name":"Pixielity"},"license":"MIT","_id":"@abdokouta/react-support@1.1.0","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/pixielity-inc/react-support#readme","bugs":{"url":"https://github.com/pixielity-inc/react-support/issues"},"dist":{"shasum":"f1f498bbd674df1f6a6031e751932bd58233a903","tarball":"https://registry.npmjs.org/@abdokouta/react-support/-/react-support-1.1.0.tgz","fileCount":10,"integrity":"sha512-AKMhCATnq9Vi7YUgBRYFchRXsYDdcQRYmCSyhi2NvjT679NjkptT3fUAZ3Zkq20e80DU6nJPDCt9ukjvLxduVQ==","signatures":[{"sig":"MEUCIQC7aJ3r0OQhR8m4DJV4ELGY3gZL+jO3fQm00wvRbWcs9wIgQU/N91W7Pl7MD35rTkQWSy/ZFH8dQ/58ZiD3wJEUlsI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":481739},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"088ea700430744c16ed3cc94b9c74a0381c7ce99","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","test":"vitest --run","build":"tsup","clean":"rm -rf dist","format":"prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"","test:ui":"vitest --ui","lint:fix":"eslint . --fix","test:watch":"vitest","check-types":"tsc --noEmit","format:check":"prettier --check \"src/**/*.{ts,tsx,js,jsx,json}\"","test:coverage":"vitest --run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"repository":{"url":"git+https://github.com/pixielity-inc/react-support.git","type":"git"},"_npmVersion":"10.9.4","description":"Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript","directories":{},"sideEffects":false,"_nodeVersion":"22.22.1","dependencies":{"collect.js":"^4.36.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","tslib":"^2.8.1","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.0","@abdokouta/react-di":"^2.1.0","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"peerDependenciesMeta":{"@abdokouta/react-di":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-support_1.1.0_1774932328952_0.8393270503166927","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@abdokouta/react-support","version":"1.2.0","keywords":["laravel","string","collection","registry","utilities","str","map","set","typescript"],"author":{"name":"Pixielity"},"license":"MIT","_id":"@abdokouta/react-support@1.2.0","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/pixielity-inc/react-support#readme","bugs":{"url":"https://github.com/pixielity-inc/react-support/issues"},"dist":{"shasum":"d4021ee6352aee3b1b0d87e270551e0d06b801cc","tarball":"https://registry.npmjs.org/@abdokouta/react-support/-/react-support-1.2.0.tgz","fileCount":10,"integrity":"sha512-Hj5K5yuqv6J+NZuxaKvYDbf9YwzV8985+eTIHjxp6uZsz7VezkKckon0VaFZaRWDFDNgYnBnRYxIFM7dYwf5uA==","signatures":[{"sig":"MEUCIHXv5NdYwFNA66Gc7x0k95dGoGUS09J1NtLwMPlinRuCAiEAhNM4H1D9mz1huF5UqhWzcH8WV+yPUVe79SotznBYeJs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":394071},"main":"dist/index.js","type":"module","_from":"file:abdokouta-react-support-1.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsup","clean":"rm -rf dist node_modules/.cache","format":"prettier --write .","release":"pnpm publish --access public --no-git-checks","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/tmp/4d5ea85f1f4329246c8c4982052398e2/abdokouta-react-support-1.2.0.tgz","_integrity":"sha512-Hj5K5yuqv6J+NZuxaKvYDbf9YwzV8985+eTIHjxp6uZsz7VezkKckon0VaFZaRWDFDNgYnBnRYxIFM7dYwf5uA==","repository":{"url":"git+https://github.com/pixielity-inc/react-support.git","type":"git"},"_npmVersion":"10.8.2","description":"Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"collect.js":"^4.36.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","jsdom":"^29.0.1","tslib":"^2.8.1","eslint":"9.39.4","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2","@abdokouta/react-di":"^2.1.3","eslint-plugin-turbo":"^2.9.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"peerDependenciesMeta":{"@abdokouta/react-di":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-support_1.2.0_1775353403964_0.39085715393802256","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@abdokouta/react-support","version":"2.0.0","keywords":["laravel","string","collection","registry","utilities","str","map","set","typescript"],"author":{"name":"Pixielity"},"license":"MIT","_id":"@abdokouta/react-support@2.0.0","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"homepage":"https://github.com/pixielity-inc/react-support#readme","bugs":{"url":"https://github.com/pixielity-inc/react-support/issues"},"dist":{"shasum":"b361750ded9689ee1f69782c779372c125f38033","tarball":"https://registry.npmjs.org/@abdokouta/react-support/-/react-support-2.0.0.tgz","fileCount":10,"integrity":"sha512-1uGYQMK5HedAGBXRYmi6yOENBXCr+hFVOx2SLhisrauA+zTzdKOKYVefuEbmYMzqVLlD62bbrbL1eIBMoanavw==","signatures":[{"sig":"MEUCIHFJx2/C87kDyytWEEnDJFq376oFOpDyEbP4DMCTdZq6AiEAu3EdVjXpeWp9bWCuy5rIoylswaov/aaSXthc1V8O9H8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":394330},"main":"dist/index.js","type":"module","_from":"file:abdokouta-react-support-2.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsup","clean":"rm -rf dist node_modules/.cache","format":"prettier --write .","release":"pnpm publish --access public --no-git-checks","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"_resolved":"/private/var/folders/7_/q437v6xs4sqf5p4755wbbzvh0000gn/T/845ba81ebfd43162e45b28cd4d649c2e/abdokouta-react-support-2.0.0.tgz","_integrity":"sha512-1uGYQMK5HedAGBXRYmi6yOENBXCr+hFVOx2SLhisrauA+zTzdKOKYVefuEbmYMzqVLlD62bbrbL1eIBMoanavw==","repository":{"url":"git+https://github.com/pixielity-inc/react-support.git","type":"git"},"_npmVersion":"10.9.7","description":"Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"collect.js":"^4.36.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","jsdom":"^29.0.1","tslib":"^2.8.1","eslint":"9.39.4","vitest":"^4.1.2","prettier":"^3.8.1","@vitest/ui":"^4.1.2","typescript":"^6.0.2","@types/node":"^25.5.2","@abdokouta/react-di":"^2.1.3","eslint-plugin-turbo":"^2.9.3","@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4"},"peerDependencies":{"@abdokouta/react-di":"^2.0.0"},"peerDependenciesMeta":{"@abdokouta/react-di":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-support_2.0.0_1775356956889_0.8400441457399892","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@abdokouta/react-support","version":"2.1.0","description":"Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript","keywords":["laravel","string","collection","registry","utilities","str","map","set","typescript"],"repository":{"type":"git","url":"git+https://github.com/pixielity-inc/react-support.git"},"license":"MIT","author":{"name":"Pixielity"},"type":"module","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","dependencies":{"collect.js":"^4.36.1"},"peerDependencies":{"@abdokouta/ts-container":"^1.2.0"},"peerDependenciesMeta":{"@abdokouta/ts-container":{"optional":true}},"devDependencies":{"@nesvel/eslint-config":"^1.0.5","@nesvel/prettier-config":"^1.0.3","@nesvel/typescript-config":"^1.0.4","@types/node":"^25.5.2","@vitest/ui":"^4.1.2","eslint":"9.39.4","eslint-plugin-turbo":"^2.9.3","jiti":"^2.6.1","jsdom":"^29.0.1","prettier":"^3.8.1","tslib":"^2.8.1","tsup":"^8.5.1","typescript":"^6.0.2","vitest":"^4.1.2"},"engines":{"node":">=20"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","clean":"rm -rf dist node_modules/.cache","typecheck":"tsc --noEmit","lint":"eslint .","lint:fix":"eslint . --fix","format":"prettier --write .","format:check":"prettier --check .","test":"vitest run --passWithNoTests","test:watch":"vitest","test:coverage":"vitest run --coverage","release":"pnpm publish --access public --no-git-checks"},"_id":"@abdokouta/react-support@2.1.0","bugs":{"url":"https://github.com/pixielity-inc/react-support/issues"},"homepage":"https://github.com/pixielity-inc/react-support#readme","_integrity":"sha512-DRu+d9UtQCAPBQvI1dir/kTVFmmnwY6LzE/iEnyEFe9q5VpPjlif3IA7PNDgrGURmW6b1+Lx4DZLKi7RFIbMdA==","_resolved":"/tmp/1738c2ad37e4548736f73ad1472074e8/abdokouta-react-support-2.1.0.tgz","_from":"file:abdokouta-react-support-2.1.0.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-DRu+d9UtQCAPBQvI1dir/kTVFmmnwY6LzE/iEnyEFe9q5VpPjlif3IA7PNDgrGURmW6b1+Lx4DZLKi7RFIbMdA==","shasum":"aff8ee1568bc7f18770bd223c246bff4bc756f67","tarball":"https://registry.npmjs.org/@abdokouta/react-support/-/react-support-2.1.0.tgz","fileCount":10,"unpackedSize":437445,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDSJUE9C5LaweRlalupqerTG+jsQwiNXRdlkXkDAInQAAIhAIHD7bc+qcJgwM4i5ws5o7DATkognDw6n/uD4eVKTyPc"}]},"_npmUser":{"name":"abdokouta","email":"akouta66@gmail.com"},"directories":{},"maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-support_2.1.0_1775420484700_0.053943638732885324"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-31T04:45:28.845Z","modified":"2026-04-05T20:21:24.928Z","1.1.0":"2026-03-31T04:45:29.099Z","1.2.0":"2026-04-05T01:43:24.097Z","2.0.0":"2026-04-05T02:42:37.114Z","2.1.0":"2026-04-05T20:21:24.840Z"},"bugs":{"url":"https://github.com/pixielity-inc/react-support/issues"},"author":{"name":"Pixielity"},"license":"MIT","homepage":"https://github.com/pixielity-inc/react-support#readme","keywords":["laravel","string","collection","registry","utilities","str","map","set","typescript"],"repository":{"type":"git","url":"git+https://github.com/pixielity-inc/react-support.git"},"description":"Laravel-style Str, Collection, and Registry utilities for JavaScript/TypeScript","maintainers":[{"name":"abdokouta","email":"akouta66@gmail.com"}],"readme":"<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/pixielity-inc/react-support/main/assets/banner.svg\" alt=\"@abdokouta/react-support\" width=\"100%\" />\n</p>\n\n<h1 align=\"center\">@abdokouta/react-support</h1>\n\n<p align=\"center\">\n  <strong>Laravel-style utilities for JavaScript/TypeScript</strong>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@abdokouta/react-support\"><img src=\"https://img.shields.io/npm/v/@abdokouta/react-support.svg?style=flat-square\" alt=\"npm version\" /></a>\n  <a href=\"https://www.npmjs.com/package/@abdokouta/react-support\"><img src=\"https://img.shields.io/npm/dm/@abdokouta/react-support.svg?style=flat-square\" alt=\"npm downloads\" /></a>\n  <a href=\"https://github.com/pixielity-inc/react-support/blob/main/LICENSE\"><img src=\"https://img.shields.io/npm/l/@abdokouta/react-support.svg?style=flat-square\" alt=\"license\" /></a>\n  <a href=\"https://github.com/pixielity-inc/react-support\"><img src=\"https://img.shields.io/github/stars/pixielity-inc/react-support?style=flat-square\" alt=\"GitHub stars\" /></a>\n</p>\n\n<p align=\"center\">\n  Powerful string manipulation, collection handling, facades, and registry patterns inspired by Laravel\n</p>\n\n---\n\n## ✨ Features\n\n- 🎯 **Str Class** - 100+ string manipulation methods matching Laravel's API\n- 📦 **Collection** - Array collection with 50+ chainable methods (powered by\n  collect.js)\n- 🗺️ **MapCollection** - Map data structure with collection methods\n- 🎲 **SetCollection** - Set data structure with collection methods\n- 🏗️ **BaseRegistry** - Generic registry pattern for building extensible systems\n- 🎭 **Facades** - Laravel-style facades for clean service access\n- 💪 **TypeScript** - Full type safety with comprehensive type definitions\n- 🔗 **Chainable** - Fluent, chainable API for elegant code\n- 🚀 **Zero Config** - Works out of the box\n\n## 📦 Installation\n\n```bash\nnpm install @abdokouta/react-support\n# or\npnpm add @abdokouta/react-support\n# or\nyarn add @abdokouta/react-support\n```\n\n## 🚀 Usage\n\n### Str Class\n\n```typescript\nimport { Str } from '@abdokouta/react-support';\n\n// String manipulation\nStr.camel('foo_bar'); // 'fooBar'\nStr.snake('fooBar'); // 'foo_bar'\nStr.kebab('fooBar'); // 'foo-bar'\nStr.studly('foo_bar'); // 'FooBar'\nStr.title('a nice title'); // 'A Nice Title'\n\n// String inspection\nStr.contains('This is my name', 'my'); // true\nStr.startsWith('Hello World', 'Hello'); // true\nStr.endsWith('Hello World', 'World'); // true\nStr.isJson('{\"key\": \"value\"}'); // true\nStr.isUrl('https://example.com'); // true\nStr.isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de'); // true\n\n// String extraction\nStr.after('This is my name', 'This is'); // ' my name'\nStr.before('This is my name', 'my'); // 'This is '\nStr.between('This is my name', 'This', 'name'); // ' is my '\n\n// String modification\nStr.limit('The quick brown fox', 10); // 'The quick...'\nStr.slug('Laravel 5 Framework', '-'); // 'laravel-5-framework'\n\n// And 80+ more methods!\n```\n\n### Collection (Array)\n\n```typescript\nimport { collect } from '@abdokouta/react-support';\n\n// Create a collection\nconst collection = collect([1, 2, 3, 4, 5]);\n\n// Chainable methods\ncollection\n  .filter((item) => item > 2)\n  .map((item) => item * 2)\n  .sum(); // 24\n\n// Working with objects\nconst users = collect([\n  { name: 'John', age: 30 },\n  { name: 'Jane', age: 25 },\n  { name: 'Bob', age: 35 },\n]);\n\nusers.where('age', '>', 25).pluck('name').all();\n// ['John', 'Bob']\n\n// Aggregation\ncollect([1, 2, 3, 4, 5]).sum(); // 15\ncollect([1, 2, 3, 4, 5]).avg(); // 3\ncollect([1, 2, 3, 4, 5]).max(); // 5\ncollect([1, 2, 3, 4, 5]).min(); // 1\n```\n\n### Facades\n\n```typescript\nimport { Facade, createFacade } from '@abdokouta/react-support';\nimport { Container } from '@abdokouta/ts-container';\n\n// Set the container for facades\nFacade.setFacadeContainer(Container.getContainer());\n\n// Create a facade for a service\nconst Config = createFacade<IConfigService>('ConfigService');\n\n// Use the facade\nConfig.get('app.name');\nConfig.set('app.debug', true);\n```\n\n### MapCollection\n\n```typescript\nimport { collectMap } from '@abdokouta/react-support';\n\nconst map = collectMap({ name: 'John', age: 30 });\n\nmap.set('city', 'New York');\nmap.get('name'); // 'John'\nmap.has('age'); // true\nmap.keys(); // ['name', 'age', 'city']\nmap.values(); // ['John', 30, 'New York']\n```\n\n### SetCollection\n\n```typescript\nimport { collectSet } from '@abdokouta/react-support';\n\nconst set1 = collectSet([1, 2, 3]);\nconst set2 = collectSet([2, 3, 4]);\n\nset1.union(set2).all(); // [1, 2, 3, 4]\nset1.intersect(set2).all(); // [2, 3]\nset1.diff(set2).all(); // [1]\n```\n\n### BaseRegistry\n\n```typescript\nimport { BaseRegistry } from '@abdokouta/react-support';\n\n// Create a typed registry\ninterface Theme {\n  name: string;\n  colors: Record<string, string>;\n}\n\nconst themeRegistry = new BaseRegistry<Theme>({\n  validateBeforeAdd: (key, theme) => {\n    if (!theme.name) {\n      return { valid: false, error: 'Theme must have a name' };\n    }\n    return { valid: true };\n  },\n  afterAdd: (key, theme) => {\n    console.log(`Registered theme: ${theme.name}`);\n  },\n});\n\n// Register items\nthemeRegistry.register('dark', { name: 'Dark', colors: { bg: '#000' } });\nthemeRegistry.register('light', { name: 'Light', colors: { bg: '#fff' } });\n\n// Retrieve items\nconst theme = themeRegistry.get('dark');\nconst allThemes = themeRegistry.getAll();\nconst hasTheme = themeRegistry.has('dark');\n```\n\n## 📘 TypeScript Support\n\nFull TypeScript support with comprehensive type definitions:\n\n```typescript\nimport {\n  Str,\n  Collection,\n  MapCollection,\n  SetCollection,\n  BaseRegistry,\n} from '@abdokouta/react-support';\n\n// Type-safe collections\nconst numbers: Collection<number> = collect([1, 2, 3]);\n\n// Type-safe maps\nconst userMap: MapCollection<string, User> = collectMap();\n\n// Type-safe sets\nconst tags: SetCollection<string> = collectSet(['tag1', 'tag2']);\n\n// Type-safe registries\nconst registry = new BaseRegistry<MyType>();\n```\n\n## 📄 License\n\nMIT\n\n## 🙏 Credits\n\n- Inspired by [Laravel](https://laravel.com)'s support package\n- Array collections powered by [collect.js](https://collect.js.org/)\n","readmeFilename":"README.md"}