|
1 | | -# 📖 Stackpress Library |
| 1 | +# Stackpress Library |
2 | 2 |
|
3 | 3 | [](https://www.npmjs.com/package/@stackpress/lib) |
4 | 4 | [](https://github.com/stackpress/lib/actions) |
5 | 5 | [](https://coveralls.io/github/stackpress/lib?branch=main) |
6 | 6 | [](https://github.com/stackpress/lib/commits/main/) |
7 | 7 | [](https://github.com/stackpress/lib/blob/main/LICENSE) |
8 | 8 |
|
9 | | -Comprehensive API documentation for the Stackpress Library - a shared library used across Stackpress projects that standardizes type definitions and provides common utilities for developers. |
10 | | - |
11 | | -## Installation |
12 | | - |
13 | | -```bash |
14 | | -npm install @stackpress/lib |
15 | | -``` |
| 9 | +Shared low-level TypeScript utilities for Stackpress projects. |
16 | 10 |
|
17 | 11 | ## API Reference |
18 | 12 |
|
19 | | -### [Data Structures](./docs/Structures.md) |
20 | | -Data structures in programming are specialized formats for organizing, processing, storing, and retrieving data within a computer's memory. |
21 | | - |
22 | | -**Key Features:** |
23 | | -- Type-safe nested object manipulation |
24 | | -- Path-based data access with dot notation |
25 | | -- Built-in parsers for query strings, form data, and arguments |
26 | | -- Chainable API for fluent data operations |
27 | | - |
28 | | -### [Events](./docs/Events.md) |
29 | | -Event driven designed to support event chain reactions. |
30 | | - |
31 | | -**Key Features:** |
32 | | -- Priority-based event listeners |
33 | | -- Type-safe event maps with TypeScript generics |
34 | | -- Before/after hooks for event execution |
35 | | -- Task queue management for event handling |
36 | | - |
37 | | -### [Exception](./docs/Exception.md) |
38 | | -Enhanced error handling with expressive error reporting and stack trace support. Provides better error information than standard JavaScript errors. |
39 | | - |
40 | | -**Key Features:** |
41 | | -- Template-based error messages |
42 | | -- Validation error aggregation |
43 | | -- Enhanced stack trace parsing |
44 | | -- HTTP status code integration |
45 | | - |
46 | | -### [Queues](./docs/Queues.md) |
47 | | -Priority-based queue implementations for managing items and tasks with FIFO ordering. Includes both generic item queues and specialized task queues. |
48 | | - |
49 | | -**Key Features:** |
50 | | -- Priority-based ordering (higher numbers execute first) |
51 | | -- FIFO ordering within same priority levels |
52 | | -- Task execution with before/after hooks |
53 | | -- Chainable API for queue operations |
54 | | - |
55 | | -### [Routing](./docs/Routing.md) |
56 | | -Event-driven routing system with generic Request and Response wrappers that work across different platforms (HTTP, terminal, web sockets). |
57 | | - |
58 | | -**Key Features:** |
59 | | -- Cross-platform request/response handling |
60 | | -- Parameter extraction from routes |
61 | | -- Event-driven architecture |
62 | | -- Generic type support for different mediums |
63 | | - |
64 | | -### [File System](./docs/Systems.md) |
65 | | -Cross-platform file loading utilities for locating, loading, and importing files throughout your project and node_modules. |
66 | | - |
67 | | -**Key Features:** |
68 | | -- Cross-platform path resolution |
69 | | -- Node modules discovery |
70 | | -- Dynamic import support |
71 | | -- Project root (@/) path shortcuts |
72 | | - |
73 | | -## [Type Safety](./docs/Types.md) |
74 | | - |
75 | | -The library is built with TypeScript and provides comprehensive type definitions. All components support generic types for enhanced type safety: |
76 | | - |
77 | | -```typescript |
78 | | -// Type-safe nested data |
79 | | -type ConfigMap = { |
80 | | - database: { host: string; port: number }; |
81 | | - cache: { ttl: number }; |
82 | | -}; |
83 | | -const config = new Nest<ConfigMap>(); |
84 | | - |
85 | | -// Type-safe event handling |
86 | | -type EventMap = { |
87 | | - 'user-login': [string, Date]; |
88 | | - 'data-update': [object]; |
89 | | -}; |
90 | | -const emitter = new EventEmitter<EventMap>(); |
91 | | - |
92 | | -// Type-safe queue operations |
93 | | -const queue = new TaskQueue<[number, string]>(); |
94 | | -``` |
95 | | - |
96 | | -## Browser Compatibility |
97 | | - |
98 | | -Most components work in both Node.js and browser environments: |
99 | | - |
100 | | -- ✅ **Nest** - Full browser support |
101 | | -- ✅ **EventEmitter** - Full browser support |
102 | | -- ✅ **Exception** - Full browser support |
103 | | -- ✅ **Queue** - Full browser support |
104 | | -- ⚠️ **FileLoader/NodeFS** - Node.js only |
| 13 | +- [Docs Index](./docs/README.md) |
| 14 | +- [Data](./docs/api/data/Nest.md) |
| 15 | +- [Events](./docs/api/events/EventEmitter.md) |
| 16 | +- [Queues](./docs/api/queue/ItemQueue.md) |
| 17 | +- [Routing](./docs/api/router/Router.md) |
| 18 | +- [System](./docs/api/system/FileLoader.md) |
| 19 | +- [Runtime](./docs/api/runtime/Exception.md) |
| 20 | +- [Types](./docs/api/types/README.md) |
0 commit comments