flâneur — a map of the web's best reading

Pipes | NestJS - A progressive Node.js framework

docs.nestjs.com · 3,444 words · saved by 1 readers

A pipe is a class annotated with the @Injectable() decorator, which implements the PipeTransform interface. Pipes have two typical use cases: In both cases, pipes operate on the arguments being processed by a controller route handler. Nest interposes a pipe just before a method is invoked, and the pipe receives the arguments destined for the method and operates on them. Any transformation or validation operation takes place at that time, after which the route handler is invoked with any (potentially) transformed arguments. Nest comes with a number of built-in pipes that you can use out-of-the-box. You can also build your own custom pipes. In this chapter, we'll introduce the built-in pipes and show how to bind them to route handlers. We'll then examine several custom-built pipes to show how you can build one from scratch. Nest comes with nine pipes available out-of-the-box: They're exported from the @nestjs/common package. Let's take a quick look at using ParseIntPipe. This is an examp

;import{$ as _e,A as Un,Aa as li,B as Vt,Ba as di,C as Yn,Ca as ci,D as tt,Da as mi,Ea as pi,F as Vn,Fa as hi,G as m,Ga as ui,H as Kn,Ha as fi,I as Qn,Ia as Ye,J as bt,Ja as St,K as W,Ka as Et,L as k,La as Ve,Ma as B,N as I,Na as xi,O as $n,Oa as gi,P as ee,Pa as bi,Q as te,Qa as j,R as yt,Ra as D,S as Ge,Sa as G,T as Ue,U as pe,V as n,W as t,X as p,Y as F,Z as L,_ as X,a as mt,aa as nt,b as Rn,ba as be,c as pt,ca as je,d as qn,da as Q,e as zn,ea as Xn,f as ht,fa as Zn,g as Fn,ga as ei,h as Je,ha as ti,i as Bn,ia as ni,j as ut,ja as b,k as Ln,ka as f,l as R,la as e,m as de,ma as ii,n as We,na

Explore this link on the map →

saved by

related reading