
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@fickou/adonis4-nats
Advanced tools
Add helper on Controller for Adonis JS 4+
Run:
npm i --save @fickou/adonis4-nats
Install provider:
Go to start/app.js
const providers = [
...,
'@fickou/adonis4-nats/providers/NatsProvider'
]
in service who you want to use
try {
const data={...};
const client = use("NatsClient");
await client.publish(`eventName`, data)
}catch (e){}
In a preload file:
Create preload file in start/nats.js.
Add in server.js.
const {Ignitor} = require('@adonisjs/ignitor');
new Ignitor(require('@adonisjs/fold'))
.appRoot(__dirname)
.preLoad('start/nats') // add
.fireHttpServer()
.catch(console.error);
After got to start/nats.js
const client = use("NatsClient");
await client.subscribe("eventName", function (message) {
console.log(message);
})
Message {
msg: Msg<any>// go to nats docs
decodeMsgContent: Record<string, any>
sub: Subscription//go to nats docs
}
docker user:
create nats-cluster.yaml
version: "3.5"
services:
nats:
image: nats
ports:
- "8222:8222"
- "4222:4222"
command: "--cluster_name nats --cluster nats://0.0.0.0:6222 --http_port 8222 "
networks: ["nats"]
volumes:
- natsData:/data
networks:
nats:
name: nats
run :
docker docker compose -f nats-cluster.yaml up -d
FAQs
adonis nats
The npm package @fickou/adonis4-nats receives a total of 83 weekly downloads. As such, @fickou/adonis4-nats popularity was classified as not popular.
We found that @fickou/adonis4-nats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.