Socket
Socket
Sign inDemoInstall

@hirosystems/api-toolkit

Package Overview
Dependencies
139
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hirosystems/api-toolkit

API development toolkit


Version published
Weekly downloads
140
decreased by-65.26%
Maintainers
4
Created
Weekly downloads
 

Readme

Source
   /     /   ▶ API Toolkit
  / --- /      A comprehensive collection of tools designed by Hiro to simplify common tasks in
 /     /       API development.

NPM Package

The API Toolkit Library is a comprehensive collection of tools designed by Hiro to simplify common tasks in API development. This library provides functionalities for database management, application shutdown handlers, migration helpers, server version management, etc. It aims to streamline the development process and improve code quality by offering convenient and reusable modules.

Installation

You can start by installing the API Toolkit Library using npm:

npm install @hirosystems/api-toolkit

You should also customize the following ENV variables that control how log messages are displayed:

APPLICATION_NAME=your-api-name
LOG_LEVEL=info

Please see each tool's source directory for additional documentation

Postgres

  • Superclass for connection support and SQL transaction management using postgres.js
  • Connection helpers with automatic retry logic, using the standard postgres ENV variables
  • Migration tools for migration apply and rollback using node-pg-migrate
  • Type definitions and conversion helpers for postgres to node type management and viceversa

Shutdown handlers

  • Node.js signal handlers that provide a way to shut down long-running application components gracefully on unhandled exceptions or interrupt signals.

Logger

  • Standardized logger configuration using pino

Server versioning

  • api-toolkit-git-info executable tool to generate API versioning information based on Git branch, tag, and latest commit
  • Helpers to extract version info to display at runtime or on documentation

Fastify

  • API server creation with CORS, Typebox and Pino logging
  • OpenAPI generator plugin with YAML and JSON exports

Helpers

  • Value conversion functions (hex strings, hashes, etc.)
  • Timer tools (stopwatch, waiters, etc.)

License

The API Toolkit Library is released under the Apache 2.0 License. See the LICENSE file for more details.

Keywords

FAQs

Last updated on 12 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc