# @joshiggins/unix-socket-credentials

> Get the uid, gid and pid of a client that connects to your unix socket server

Latest version **0.2.0** (published 2018-04-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @joshiggins/unix-socket-credentials
pnpm add @joshiggins/unix-socket-credentials
yarn add @joshiggins/unix-socket-credentials
bun add @joshiggins/unix-socket-credentials
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-04-18 |
| First published | 2018-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | spion |
| Maintainers | joshiggins |
| Keywords | unix, socket, credentials, uid, gid, pid |

## Links

- npm: https://www.npmjs.com/package/@joshiggins/unix-socket-credentials
- Repository: https://github.com/spion/node-unix-socket-credentials
- Homepage: https://github.com/spion/node-unix-socket-credentials#readme
- Issues: https://github.com/spion/node-unix-socket-credentials/issues
- npm.io page: https://npm.io/package/@joshiggins/unix-socket-credentials

## Dependencies (3)

- [ffi](https://npm.io/package/ffi.md) ~2.2.0
- [ref](https://npm.io/package/ref.md) ^1.3.5
- [ref-struct](https://npm.io/package/ref-struct.md) ^1.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-04-18

## README

# node-unix-socket-credentials

Get the uid, gid and pid of a client that connects to your node.js unix socket server

Writing multi-user system services in node has suddenly become much easier!

# install

From npm

    npm install unix-socket-credentials

# usage

Sync and async methods are provided:

Full async example:

```js
var uscred = require('unix-socket-credentials');
var net = require('net');

net.createServer(function(cli) {
    uscred.getCredentials(cli, function(err, res) {
        // You can now use the uid/gid/pid of the client process
        console.log(res.uid, res.gid, res.pid);
    });
}).listen('/tmp/test.sock');
```


Shortened sync example:

```js
var res = uscred.getCredentialsSync(cli);
console.log(res.uid, res.gid, res.pid);
```

# licence

MIT

---
_Source: https://npm.io/package/@joshiggins/unix-socket-credentials · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
