Skip to content

Commit

Permalink
docs: add cli documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonecorsi committed Jan 27, 2023
1 parent 38588aa commit eeb6fec
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Supports Node.js `>=14.0.0`, if you are a Node.js `v12` user refer to `[email protected].
- [`Client.gauge(string, value)`](#clientgaugestring-value)
- [`Client.set(string, value)`](#clientsetstring-value)
- [Dats Mock](#dats-mock)
- [CLI Interface](#cli-interface)
- [CLI Usage](#cli-usage)
- [Benchmarks](#benchmarks)
- [Powered Apps](#powered-apps)
- [Support & Contribute](#support--contribute)
Expand Down Expand Up @@ -240,6 +242,31 @@ console.log(client.metrics);
*/
```

## CLI Interface

dats is also exposed as a CLI that can both be installed as a npm global package or a precompiled binary.

The precompile binary can be found in the [release section](https://github.com/immobiliare/dats/releases) for linux, macos or window.

### CLI Usage

```sh
$ npm i -g @immobiliarelabs/dats
dats --help
# ℹ️ The following are required input flags:
#
# --host {string} []
# --port {string} []
# --type {string} [Metric type can be one of: counter, timing, gauge, set]
# --prefix {string} [Metric prefix]
# --namespace {string} [Metric full namespace, use dots `.` to separate metrics]
# --value {string} [Metric value]
# --quiet {boolean} [Suppress all console output]
# --dryRun {boolean} [Metric wont be sent, use for debug]
#
# If unsure of output run the command prepended with `DRY_RUN=1`
```

## Benchmarks

The automatic benchmarking for every commit can be found at the following links: [next](https://immobiliare.github.io/dats/next/bench/index.html) and
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@immobiliarelabs/dats",
"version": "3.0.1",
"description": "Minimalistic zero-dependencies UDP/TCP statsd client for Node.js",
"bin": "./dist/dats-cli.js",
"bin": {
"dats": "./dist/dats-cli.js"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
Expand Down

0 comments on commit eeb6fec

Please sign in to comment.