New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nestjs-fastify-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-fastify-loader

Nestjs fastify loader is custom module for inject any fastify plugin

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

nestjs-fastify-loader

Nestjs nestjs module to register fastify plugins

Install

npm install nestjs-fastify-loader

Or, if you use yarn

yarn add nestjs-fastify-loader

Documentation

Getting Started

Create plugin or use existing plugin.

import fp from 'fastify-plugin';
import proxy from '@fastify/http-proxy';

export default fp(async (fastify) => {
  void fastify.register(proxy, {
    upstream: "url",
    prefix: '/api',
    proxyPayloads: false,
  });
});

Import FastifyLoaderModule on the module you want to use

// One plugin

import { Module } from '@nestjs/common';
import { FastifyLoaderModule } from '@rbonillajr/nestjs-fastify-loader';
import proxy from 'plugin path'

@Module({
  imports: [
    FastifyLoaderModule.forRoot(proxy),
  ],
})
export class ExampleModule {}
// More than one plugin

import { Module } from '@nestjs/common';
import { FastifyLoaderModule } from '@rbonillajr/nestjs-fastify-loader';
import proxy from 'plugin path'

const plugins = [];
plugins.push(proxy);

@Module({
  imports: [
    FastifyLoaderModule.forRoot(plugins),
  ],
})
export class ExampleModule {}

FAQs

Package last updated on 02 Nov 2022

Did you know?

Socket

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