Socket
Socket
Sign inDemoInstall

@notifications-system/storage-typeorm-0.3

Package Overview
Dependencies
1
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @notifications-system/storage-typeorm-0.3

Notifications TypeORM storage


Version published
Maintainers
2
Created

Readme

Source

Notifications System TypeORM-v0.3 storage

Description

TypeORM v0.3 storage for Notifications System

Install

npm i @notifications-system/storage-typeorm-0.3

Migrations:

  • Copy migrations from library to project migrations directory
cp ./node_modules/@notifications-system/storage-typeorm-0.3/migrations/*.js ./migrations/
  • Run migrations
./node_modules/.bin/typeorm migration:run
  • Revert migrations
./node_modules/.bin/typeorm migration:revert

TypeORM config:

Sample usage:

import { ConsoleTransport, NotificationQueueManager, NotificationService, TRANSPORT_CONSOLE } from '@notifications-system/core';
import { TypeormStorage } from '@notifications-system/storage-typeorm-0.3';

let service: NotificationService;

async function main() {
  // Instantiate Notification Service
  service = new NotificationService(
    await new TypeormStorage().initialize(require('./ormconfig.js')),
    [
      new ConsoleTransport(), // Log all notification to console (for test/demo purpose)
    ],
  );
  new NotificationQueueManager(service).queueStart();


  // Sample usage
  service.send(TRANSPORT_CONSOLE, { recipient: 'user@mail.test', payload: 'Test Notification' });
}

Keywords

FAQs

Last updated on 13 Sep 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc