Node.js Framework Series — 1.2.7. NestJS — Pipes

We create a pipe as a class with the @Injectable() decorator which should implement the PipeTransform interface. In general we use the pipes for the following cases:

  • Transformation: to transform input data to the desired form(i.e., string to JSON object, integer to string..)
  • Validation: to check the input data (e.g., JSON schema validation — if data is not valid, throw an exception..)
NestJs Architecture — Pipes

--

--

Rasim Sen/Blockchain Architect-zero2hero founder

I am a blockchain architect, close on 2 decades of experience as a developer, I’ve got 5 products in blockchain, and I like to talk about tech,sci-fi, futurism!