Skip to content

Commit

Permalink
chore: document exports
Browse files Browse the repository at this point in the history
  • Loading branch information
csimi committed Nov 20, 2019
1 parent 54215a8 commit 2c452eb
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"keywords": [
"syslog",
"optional",
"windows"
"windows",
"posix"
]
}
55 changes: 53 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

# About

This package installs modern-syslog as an optional dependency for ease of use on Windows and exposes some of its API including a compatibility layer for users of the POSIX package.
Syslog constants are used from [syslog-constants](https://www.npmjs.com/package/syslog-constants).
This package installs [modern-syslog](https://www.npmjs.com/package/modern-syslog) as an optional dependency for ease of use on Windows (via a stub) and exposes some of its API.

There is also a compatiblity layer for users of the [posix](https://www.npmjs.com/package/posix) package (syslog related functions, drop-in replacement).

Constants are provided by [syslog-constants](https://www.npmjs.com/package/syslog-constants) and are always available.

# Usage

Expand All @@ -12,3 +15,51 @@ Install using npm:
```
$ npm install optional-syslog
```

Replace
```
require('modern-syslog');
```
or
```
require('posix');
```

with
```
require('optional-syslog');
```

# Exported properties and methods

## syslog-constants (except named as in modern-syslog)

* facility
* level
* option

Documentation at https://www.npmjs.com/package/syslog-constants#properties

## modern-syslog

* log
* open
* close
* upto
* setmask

Documentation at https://www.npmjs.com/package/modern-syslog#api

Not provided are:
* formatted versions of `log()`
* streaming API
* curmask (since it's a read operation and can't be noop'd)

## posix

* openlog
* closelog
* setlogmask
* syslog

Documentation at https://www.npmjs.com/package/posix#syslog

0 comments on commit 2c452eb

Please sign in to comment.