Skip to content

Console utilities and libraries for projects in ilink-pro-team

License

Notifications You must be signed in to change notification settings

i-link-pro-team/ilink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Console ilink tools

npm version monthly downloads

Installation

npm i -g ilink-console-tools

Links

https://github.com/i-link-pro-team/ilink/blob/master/libs/ilink-console-tools/README.md - full readme

Usage

# upload from file to consul-kv
ilink-console-tools env-to-consul --path=.env --consul-token=myCustomToken --consul-host=localhost
# download from consul-kv to file
ilink-console-tools consul-to-env --consul-token=myCustomToken --path=.env --consul-host=localhost

NestJS library for work with consul-kv

npm version monthly downloads

Installation

npm i --save consul nestjs-consul-kv-realtime

Links

https://github.com/i-link-pro-team/ilink/blob/master/libs/nestjs-consul-kv-realtime/README.md - full readme

Usage

Simple usage with global watchers for consul-kv

import { Module } from '@nestjs/common';
import { NestjsConsulKvRealtimeModule } from 'nestjs-consul-kv-realtime';

@Module({
  imports: [
    NestjsConsulKvRealtimeModule.forRootAsync({
      useFactory: async () => ({
        port: '8500',
        host: 'localhost',
        defaults: {
          token: `CONSUL_HTTP_TOKEN`,
        },
        watchers: [
          {
            interval: 1000,
            key: 'consul-key',
            callback: async (value: { key: string }) => {
              console.log('New value from consul:', value);
            },
          },
        ],
      }),
    }),
  ],
})
export class AppModule {}

License

MIT