npm.io
1.0.7 • Published 5 years agoCLI

pub-sub-seeder

Licence
MIT
Version
1.0.7
Deps
1
Size
5 kB
Vulns
0
Weekly
0

PubSub Seeder

PubSub Seeder written in JS as CLI command for extreme convenience usage

alt text

Install

npm install pub-sub-seeder 

OR globally

npm install -g pub-sub-seeder
Optionally
gcloud components install pubsub-emulator

Required envs

For emulator
export PUBSUB_PROJECT_ID=test
export PUBSUB_EMULATOR_HOST=localhost:8085
For GCP pub-sub
export PUBSUB_PROJECT_ID=test
export PUBSUB_CLIENT_EMAIL=
export PUBSUB_PRIVATE_KEY=

Usage

./node_modules_location/pub-sub-seeder/bin/seed.js topic-subs.json

or if installed globally

pub-sub-seed topic-subs.json

Example file


[
    {
      "topic": "Topic1",
      "subscriptions": ["SubForTopic1"]
    }, 
    {
      "topic": "Topic2",
      "subscriptions": ["SubForTopic2", "SecondSubForTopic2"]
    }
]

Keywords