# morgan-ym-d-log-stream

> A stream tool, mainly a plugin for morgan, to save log to file dir/YYYY/M/YYYY-MM-DD.log

Latest version **1.0.2** (published 2022-10-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install morgan-ym-d-log-stream
pnpm add morgan-ym-d-log-stream
yarn add morgan-ym-d-log-stream
bun add morgan-ym-d-log-stream
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-10-09 |
| First published | 2022-10-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fwg |
| Maintainers | adf0001 |
| Keywords | morgan, stream, YMD |

## Links

- npm: https://www.npmjs.com/package/morgan-ym-d-log-stream
- Repository: https://github.com/adf0001/morgan-ym-d-log-stream
- Homepage: https://github.com/adf0001/morgan-ym-d-log-stream#readme
- Issues: https://github.com/adf0001/morgan-ym-d-log-stream/issues
- npm.io page: https://npm.io/package/morgan-ym-d-log-stream

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-10-09
- 1.0.1 — 2022-10-07
- 1.0.0 — 2022-10-06

## README

# morgan-ym-d-log-stream
A stream tool, mainly a plugin for morgan, to save log to file dir/YYYY/M/YYYY-MM-DD.log

# Install
```
npm install morgan-ym-d-log-stream
```

# Usage & Api
```javascript
var morgan_ym_d_log_stream = require("morgan-ym-d-log-stream");

/*
create a log stream
createLogStream( logDir )
*/
var logStream = morgan_ym_d_log_stream(path.join(__dirname, "log"));

var logger = morgan( 'common', { stream: logStream } );		//creata a morgan function by the stream

/*
write a string
	.write(str)
*/
logStream.write("test, " + (new Date()).toLocaleString() + "\n");

/*
get current log file path
	.currentFilePath()
*/
console.log(logStream.currentFilePath());

```

---
_Source: https://npm.io/package/morgan-ym-d-log-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
