ngx-oneforall
v1.5.0
Published
A comprehensive Angular utility library with decorators, directives, guards, interceptors, signals, pipes, validators, and more.
Maintainers
Readme

ngx-oneforall is a collection of 120+ high-quality Angular utilities designed to solve common development challenges. Instead of reinventing the wheel or managing dozens of small dependencies, you get a unified toolkit that just works.
One For All - A single library providing the essential blocks for modern Angular development.
Documentation
Full API documentation and demos are available at: https://love1024.github.io/ngx-oneforall/
Key Features
- Performance First: Every utility is written from scratch and optimized specifically for Angular.
- Tree-Shakable: Import only what you need. Zero bundle bloat—no utility exceeds 3kb gzipped.
- Zero Dependencies: Keeps your dependency tree clean and secure.
- SSR Ready: Built for modern hydration and server-side rendering.
- Modern Angular: Designed for Signals and Standalone Components.
- AI Ready: Includes an MCP server to easily integrate documentation and utilities directly into AI assistants.
- Fully Tested: Comprehensive test suite with 100% coverage.
Why Use It?
- Stop Re-writing Utilities: Avoid copy-pasting the same services, directives, validators, and helper functions between projects.
- Focus on Business Logic: Don't waste time maintaining generic boilerplate code. Use proven primitives.
- Better Developer Experience: Fully typed APIs and consistent behavior make coding a joy.
Requirements
- Angular: 17.1+ / 18.x / 19.x / 20.x / 21.x
- RxJS: 7.x or 8.x
Installation
npm install ngx-oneforallOr
yarn add ngx-oneforallOptional Dependencies
For phone validator, install:
npm install libphonenumber-jsUsage
Simply import what you need. ngx-oneforall is fully tree-shakable.
Example: Using @Cache Decorator
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Cache } from 'ngx-oneforall/decorators/cache';
@Injectable({ providedIn: 'root' })
export class UserService {
constructor(private http: HttpClient) {}
// Cache results for 1 minute in localStorage
@Cache({ ttl: 60000, storage: 'local' })
getUser(id: number): Observable<User> {
return this.http.get<User>(`/api/users/${id}`);
}
}Available Utilities
| Category | Utilities |
|----------|-----------|
| Constants | breakpoints, device, file-extension, host-platforms, http, keys, regex, sort-direction, time, types |
| Decorators | cache, catch-error, debounce, log-execution-time, memoize, only-in-browser, throttle |
| Directives | auto-focus, click-outside, click-throttle, datetime, drag-auto-scroll, draggable, hover-class, infinite-scroll, lowercase, mask, numbers-only, press-enter, repeat, resized, shortcut, typed-template, uppercase, visibility-change |
| Guards | param, query-param, unsaved-changes |
| Interceptors | base-url, cache, correlation-id, encryption, jwt, performance, timeout |
| Pipes | bytes, call, first-error-key, highlight-search, initials, mask, pluralize, range, safe-html, time-ago, truncate |
| Rxjs | backoff-retry, catch-error-with-fallback, data-polling, debug, live-search, loading-status |
| Services | cache, clipboard, cookie, device, event, history, idle, jwt, logger, network-status, shortcut, storage |
| Signals | breakpoint-matcher, debounced-signal, deep-computed, event-signal, interval-signal, route-param-signal, route-query-param-signal, router-event-signal, state-signal, storage-signal, throttled-signal, websocket-signal |
| Types | callable, deep-partial, is-arrow-function, keys-of-type, omit-by-value, partial-only, pick-by-value, required-only, simple-changes |
| Utils | base64-url, download-link, file-base64, find-type, hash, host-platform, is-key-defined, is-number, is-present, is-record, normalize-key, safe-await, safe-serialize, unique-component-id |
| Validators | credit-card, date, match-field, max-date, min-date, min-length-trimmed, not-blank, number, phone, range, range-length, url |
MCP Server
This project includes a Model Context Protocol (MCP) server. You can use the ngx-oneforall MCP server to integrate its Angular utilities directly into your AI assistants and tools (like Claude Desktop, Cursor, and Windsurf).
For more information on setting up and using the MCP server, please refer to the MCP Server Documentation.
Issues & Feature Requests
Found a bug or edge case? Have an idea for a new utility? We'd love to hear from you!
- Report Issues: If you encounter any bugs or unexpected behavior, please open an issue.
- Feature Requests: Have a utility in mind that would benefit the community? Submit a feature request via GitHub Issues.
Contributing
Contributions are welcome!
- Create a feature branch.
- Commit your changes.
- Make sure tests are passing and coverage is 100%.
- Make sure build is successful and there are no linting errors.
- Submit a pull request.
License
MIT License. See LICENSE for details.
