Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fphgov/nestjs-meilisearch

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fphgov/nestjs-meilisearch

Meilisearch integration for NestJS.

  • 2.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-36.84%
Maintainers
2
Weekly downloads
 
Created
Source

About

This package is a simple wrapper around meilisearch-js.

Installation

This package requires meilisearch dependency to work properly.

yarn add @fphgov/nestjs-meilisearch meilisearch

Getting Started

The simplest way to use @fphgov/nestjs-meilisearch is to use MeiliSearchModule.forRoot or MeiliSearchModule.forRootAsync

import { Module } from '@nestjs-common';
import { MeiliSearchModule } from '@fphgov/nestjs-meilisearch';

@Module({
  imports: [
    MeiliSearchModule.forRoot({
      host: 'http://127.0.0.1:7700',
      apiKey: 'masterKey',
    }),
  ],

  // or async
  MeiliSearchModule.forRootAsync({
    useFactory: () => ({
      host: 'http://127.0.0.1:7700',
      apiKey: 'masterKey',
    }),
  }),
})
export class AppModule {}

use @InjectMeiliSearch() decorator in any injectables to get a MeiliSearch client inside class

import { Injectable } from '@nestjs/common';
import { InjectMeiliSearch } from '@fphgov/nestjs-meilisearch';
import { MeiliSearch } from 'meilisearch';
@Injectable()
export class TestService {
  public constructor(
    @InjectMeiliSearch() private readonly meiliSearch: MeiliSearch,
  ) {}
}

You can also use MeiliSearchService to add,update and delete documents. I'm planning to add further operations to this service.

License

Distributed under the MIT License. See LICENSE for more information.

Keywords

FAQs

Package last updated on 11 Aug 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc