Skip to content

Gaspar1992/angular-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

186 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Angular Helpers

A suite of Angular libraries that helps you build secure, browser-integrated applications with a clean developer experience.


πŸ“¦ Available Packages

πŸ” @angular-helpers/security

Advanced regular expression security and ReDoS prevention

🌐 Documentation: https://gaspar1992.github.io/angular-helpers/docs/security

🎯 What it solves:

  • ReDoS (Regular Expression Denial of Service) attacks caused by malicious or expensive patterns.
  • Safe validation of complex regular expressions without blocking your app.
  • Controlled regex execution with timeout and security analysis.

✨ Key features:

  • πŸ›‘οΈ ReDoS prevention with automatic risky pattern checks.
  • ⚑ Web Worker execution to avoid blocking the main thread.
  • πŸ• Configurable timeout to limit expensive regex operations.
  • πŸ“Š Risk analysis with complexity metrics and recommendations.
  • πŸ—οΈ Builder pattern for fluent secure-regex configuration.

πŸ’‘ Example usage:

// Safe regex validation for user input
const result = await securityService.testRegex(userInput, text, {
  timeout: 5000,
  safeMode: true,
});

// Builder pattern for complex patterns
const { pattern, security } = RegexSecurityService.builder()
  .pattern('\\d+')
  .timeout(3000)
  .safeMode()
  .build();

πŸ“₯ Installation:

npm install @angular-helpers/security

🌐 @angular-helpers/browser-web-apis

Unified and safe browser API access with permissions and robust error handling

🌐 Documentation: https://gaspar1992.github.io/angular-helpers/docs/browser-web-apis

🎯 What it solves:

  • API fragmentation across browsers.
  • Permission complexity for sensitive browser features.
  • Compatibility checks that usually require repetitive boilerplate.
  • Inconsistent error handling across web APIs.

✨ Key features:

  • πŸ“Έ Camera access and stream control.
  • πŸ—ΊοΈ Geolocation with watch support and typed errors.
  • πŸ”” Notifications with permission-aware behavior.
  • πŸ“‹ Clipboard utilities.
  • πŸŽ₯ Media Devices enumeration and media access.
  • πŸ” Centralized permission utilities.
  • βœ… Device/browser API wrappers with fallback checks.
  • ⚑ Signal Fn primitives β€” 9 zero-boilerplate reactive inject functions (injectPageVisibility, injectResizeObserver, injectIntersectionObserver, injectNetworkInformation, injectScreenOrientation, injectMutationObserver, injectPerformanceObserver, injectIdleDetector, injectGamepad) with automatic cleanup and viewChild signal support.

πŸ“₯ Installation:

npm install @angular-helpers/browser-web-apis

πŸš€ @angular-helpers/worker-http (Preview)

Angular HTTP over Web Workers β€” off-main-thread HTTP pipelines

🎯 What it solves:

  • Main-thread blocking from heavy HTTP payloads and serialization.
  • Request signing complexity with WebCrypto HMAC.
  • Serialization overhead with pluggable format support.

✨ Key features:

  • πŸ”€ Off-main-thread HTTP pipelines via Web Workers.
  • πŸ”Œ Typed RPC bridge for structured worker communication.
  • πŸ” WebCrypto HMAC request signing.
  • πŸ“¦ Pluggable serializers (TOON, seroval, auto-detect).

⚠️ This package is in preview. APIs may change before v1.0.

πŸ“₯ Installation:

npm install @angular-helpers/worker-http

🎯 Why Angular Helpers?

⚑ Immediate Productivity

  • Unified APIs for common browser capabilities.
  • Strict TypeScript support and better autocomplete.
  • Practical examples and ready-to-use patterns.
  • End-to-end browser test coverage in CI.

πŸ›‘οΈ Security by Default

  • ReDoS prevention tools for regex-heavy flows.
  • Permission-aware wrappers for sensitive APIs.
  • Worker-based isolation for expensive operations.
  • Predictable error handling paths.

πŸ”„ Modern Stack Alignment

  • Built for modern Angular versions and patterns.
  • Browser-focused utilities tested with Playwright.
  • Actively maintained workflows and test harnesses.

πŸš€ Quick Start

Workspace Setup

# Clone the repository
git clone https://github.com/Gaspar1992/angular-helpers
cd angular-helpers

# Install dependencies
npm install

# Generate local SSL certificates
npm run ssl:generate

# Start demo app over HTTPS
npm run start:https

Use in Your Project

# Install the packages you need
npm install @angular-helpers/security
npm install @angular-helpers/browser-web-apis
npm install @angular-helpers/worker-http  # preview

For modern Angular standalone integration, check each package's own README.


πŸ“Š Comparison

Feature Angular Helpers Manual Implementation Other Libraries
ReDoS Protection βœ… Built-in ❌ Manual ⚠️ Partial
Browser APIs βœ… Unified ❌ Fragmented ⚠️ Limited
TypeScript βœ… Full support ⚠️ Partial ❌ Minimal
Testing βœ… Included ❌ Manual ⚠️ Basic
Documentation βœ… Comprehensive ❌ Missing ⚠️ Basic
Support βœ… Active ❌ Team-owned only ⚠️ Varies

πŸ› οΈ Development

Available Scripts

# Generate SSL certificates (local/CI)
npm run ssl:generate

# Local HTTPS development (required for secure browser APIs)
npm run start:https

# Build all packages
npm run build:packages

# Browser tests on Chromium
npm run test:browser

# Browser tests for CI (Chromium, 1 worker)
npm run test:browser:ci

# Cross-browser smoke tests (Firefox + WebKit)
npm run test:browser:cross

# Workspace linting
npm run lint

Project Structure

angular-helpers/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ security/          # πŸ“¦ @angular-helpers/security
β”‚   β”œβ”€β”€ browser-web-apis/  # πŸ“¦ @angular-helpers/browser-web-apis
β”‚   └── worker-http/       # πŸ“¦ @angular-helpers/worker-http (preview)
β”œβ”€β”€ src/                   # πŸš€ Demo application
β”œβ”€β”€ docs/                  # πŸ“š Documentation
└── scripts/               # πŸ”§ Automation scripts

πŸ“ˆ Roadmap

Planned 🚧

  • @angular-helpers/pwa - Service Worker and PWA capabilities.
  • @angular-helpers/storage - Unified storage helpers.

In Progress πŸ”„

  • @angular-helpers/worker-http β€” transport, serializer, backend, interceptors, and crypto sub-entry points.
  • Runtime and bundle-size improvements.
  • More real-world examples and demos.

🀝 Contributing

Contributions are welcome.

Getting Started

# Fork and clone
git clone https://github.com/your-user/angular-helpers
# or fork from https://github.com/Gaspar1992/angular-helpers
cd angular-helpers

# Create a feature branch
git checkout -b feature/your-feature

# Commit and push
git commit -m "feat: add your feature"
git push origin feature/your-feature

Contribution Guides


πŸ“„ License

MIT License β€” see LICENSE for details.


πŸ”— Useful Links


⭐ If Angular Helpers helps your team, consider starring the repository.

Made with ❀️ by the Angular Helpers Team

About

A suite of Angular libraries that helps you build secure, browser-integrated applications with a clean developer experience.

Resources

Stars

Watchers

Forks

Contributors