Skip to content

Commit

Permalink
feat: allow to start programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Nov 6, 2023
1 parent d3a8b13 commit db56055
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [aedes-cli](#aedes-cli)
- [Install](#install)
- [Usage](#usage)
- [Programmatically](#programmatically)
- [Docker](#docker)
- [Authorization](#authorization)
- [Persistence and Emitters](#persistence-and-emitters)
Expand Down Expand Up @@ -145,6 +146,18 @@ module.exports = {

```

## Programmatically

You can also use `aedes-cli` programmatically:

```js
const { start, adduser, rmuser } = require('aedes-cli')

start({
protos: ['tcp'],
})
```

## Docker

`aedes-cli` is available on [Docker-Hub](https://hub.docker.com/r/moscajs/aedes) for `amd64, arm64v8, arm32v6, arm32v7, i386` archs. If you want to use a local `credentials.json` file and/or a custom config file to pass using `--config` option you have to use docker volumes and map the local folder containing those files to a folder inside the container.
Expand Down
4 changes: 4 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,3 +495,7 @@ module.exports = async function cli (cliArgs) {

return command
}

module.exports.start = start
module.exports.adduser = adduser
module.exports.rmuser = rmuser
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "aedes-cli",
"version": "0.7.0",
"description": "Aedes MQTT broker from cli",
"main": "index.js",
"main": "./lib/cli.js",
"bin": {
"aedes": "./bin/aedes"
},
Expand Down

0 comments on commit db56055

Please sign in to comment.