Overview of psn-api features and design philosophy
mainOverview
psn-api is a JavaScript library designed to retrieve trophy, user, and game data from the PlayStation Network.
Key Features
- Lightweight: The library is less than 3Kb in size.
- Zero Configuration: No setup or configuration is required to start using the functions.
- TypeScript Support: Built-in TypeScript support is available out of the box.
- High Test Coverage: The library maintains 100% test coverage.
Design Philosophy: Low-level vs. High-level
Unlike other PSN wrappers that provide high-level abstractions (where a single function call might trigger multiple hidden network requests), psn-api follows a low-level, UNIX-like approach:
- Single Responsibility: Each function performs exactly one API call. This makes it easier to compose complex logic by combining small, predictable building blocks.
- Resilience: Because functions are low-level, the library is easier to maintain and fix when Sony changes specific endpoints, without breaking entire high-level abstractions.
- Isolation: Functions work in isolation, allowing you to use only the specific parts of the library you need.