# log-to-file

> Log text to file (with timestamp)

Latest version **3.0.3** (published 2022-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install log-to-file
pnpm add log-to-file
yarn add log-to-file
bun add log-to-file
```

## 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 | 3.0.3 |
| Published | 2022-10-03 |
| First published | 2016-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Volodymyr Sichka |
| Maintainers | volodymyr.sichka |
| Keywords | log, logs, file, error, time |

## Links

- npm: https://www.npmjs.com/package/log-to-file
- Repository: https://gitlab.com/vsichka/log-to-file.npm
- Homepage: https://gitlab.com/vsichka/log-to-file.npm#README
- Issues: https://gitlab.com/vsichka/log-to-file.npm/issues
- npm.io page: https://npm.io/package/log-to-file

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 3.0.3 (latest) — 2022-10-03
- 3.0.2 — 2022-10-03
- 3.0.1 — 2022-09-29
- 3.0.0 — 2021-11-01
- 2.0.2 — 2019-10-18
- 2.0.1 — 2019-04-11
- 2.0.0 — 2019-04-11
- 1.3.0 — 2018-12-03
- 1.2.2 — 2017-12-23
- 1.2.1 — 2016-08-12
- 1.2.0 — 2016-08-08
- 1.1.1 — 2016-08-05
- 1.1.0 — 2016-08-05
- 1.0.0 — 2016-08-02

## README

# log-to-file

[![NPM Downloads][downloads-image]][downloads-url]

## Description

Log text to file (with timestamp).

## Installation

```sh
npm install log-to-file --save
```

## Using

```js
// Import.
const log = require('log-to-file');

// Save log to default log file "default.log".
log('Some data');

// Save log to custom log file "my-log.log".
log('Another data', 'my-log.log');

// Save log to custom log file "my-log.log" with delimiter "\r\n"
// (default delimiter "\n").
log('Another data', 'my-log.log', '\r\n');
```

## Log samples

```
2022.09.25, 08:47:31.0338 UTC -> Some log text.
2022.09.25, 08:47:33.0448 UTC -> Some other log text.
```

## License

The MIT License (MIT)

Copyright © 2016 - 2022 Volodymyr Sichka

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[downloads-image]: https://img.shields.io/npm/dm/log-to-file.svg
[downloads-url]: https://npmjs.org/package/log-to-file

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