npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@puq/orm

v0.6.20

Published

The custom TypeORM decorators extend standard entity definitions by seamlessly integrating validation and API documentation within a single decorator. These decorators ensure that database entities are not only mapped efficiently but also validated at the

Downloads

90

Readme

@puq/orm

Summary

The custom TypeORM decorators extend standard entity definitions by seamlessly integrating validation and API documentation within a single decorator. These decorators ensure that database entities are not only mapped efficiently but also validated at the DTO level while providing clear API documentation using Swagger.

Database entity development is streamlined through the integration of intuitive and widely adopted implementations within decorators. These decorators are paired with class-validator, class-transformer, and @nestjs/swagger, enhancing efficiency in the development process. This approach achieves a minimum reduction of 60% in both code volume and associated errors.

Install

  pnpm add @puq/orm

SQLite

  • SQLite does not support array or object data types. To accommodate this limitation, data must be transformed into a string format.

Postgres Datasource

To optimize datasource performance, implement the following configuration settings:

  • poolSize: Set to 50. This defines the maximum number of connections allowed in the pool, ensuring efficient resource utilization while accommodating peak demand.
  • min: Set to 10. This specifies the minimum number of connections maintained in the pool, keeping a baseline of readily available connections to reduce latency during low-traffic periods.
  • max: Set to 50. This establishes the upper limit of open connections, balancing system performance with resource availability to prevent overloading.
  • idleTimeoutMillis: Configure to 30,000 milliseconds. This determines the duration an idle connection remains open before being closed, minimizing unnecessary resource consumption during periods of inactivity.
  • connectionTimeoutMillis: Configure to 2,000 milliseconds. This sets the maximum time allowed to establish a connection, enhancing application responsiveness by preventing prolonged delays.

Postgres Server

Adjust the PostgreSQL server configuration file (postgres.conf) with the following settings:

  • max_connections: Set to 200 to accommodate both application and administrative connections, ensuring sufficient capacity.
  • shared_buffers: Allocate 25-40% of the server's RAM for optimal performance, configured to 4GB.
  • work_mem: Define the memory allocation per query or sort operation, set to 16MB to enhance query efficiency.

Numbers

  • The number data type is stored as a string (numeric) to ensure the preservation of precision.
  • The number value is not converted to a JavaScript number to avoid disrupting query operations.

Typeorm Column Transformer

  • Refrain from using TypeORM column transformers, as they may interfere with query operations. Instead, implement transformations within the data transfer layer.

Hashing and encrypion

  • Hashing should be done in database layer. Typeorom column transformer is safe to use
  • Encryption is done in controller layer
  • For handling encrypted data, implement a dedicated data transfer object (DTO) class and apply it subsequent to the execution of the initial DTO class within the controller

Funding

Thank you for using @puq/orm It's an open-source project, and maintaining it takes time and effort. If you find this library useful, please consider supporting its ongoing development. Your contributions help ensure that the project stays up-to-date, secure, and well-maintained.

Instant Funding

Your funding will go toward

  • Bug fixes and updates to ensure compatibility with the latest versions of dependencies.
  • New features that will make the library even more powerful.
  • Documentation improvements to help users get the most out of [Your Library Name].
  • General maintenance to keep the library running smoothly and securely.

Contact to the developer: [[email protected]]

Support the developer