# ndlogger

> The logger messages

Latest version **1.0.7** (published 2019-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ndlogger
pnpm add ndlogger
yarn add ndlogger
bun add ndlogger
```

## 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.7 |
| Published | 2019-07-29 |
| First published | 2019-07-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | neovav |
| Maintainers | neovav |

## Links

- npm: https://www.npmjs.com/package/ndlogger
- npm.io page: https://npm.io/package/ndlogger

## Dependencies (1)

- [interval-promise](https://npm.io/package/interval-promise.md) 1.3.0

## Recent versions

- 1.0.7 (latest) — 2019-07-29
- 1.0.6 — 2019-07-28
- 1.0.5 — 2019-07-27
- 1.0.4 — 2019-07-27
- 1.0.3 — 2019-07-26
- 1.0.2 — 2019-07-26
- 1.0.1 — 2019-07-26
- 1.0.0 — 2019-07-25

## README

ndLogger - logger library for NodeJs
====================================

## Quick Start

This guide will show you how to set up a simple application using Node.js and ndLogger


### Create the `package.json` file

First, create a directory where your application will live.

```bash
mkdir myproject
cd myproject
```

Enter the following command and answer the questions to create the initial structure for your new project:

```bash
npm init
```

Next, install the driver dependency.

```bash
npm install ndlogger --save
```

You should see **NPM** download a lot of files. Once it's done you'll find all the downloaded packages under the **node_modules** directory. 

### Usage

Save file as **example.js**

```js
const fs   = require('fs');
const req  = require('ndlogger');
const con  = require('ndlogger/lib/LogToConsole');

con.setTime();

const err = req.ERR;

let opt = {};
opt[err] = __dirname + '/log/err.log';

const logToConsole = req.getLogToConsole();
const logToFile = req.getLogToFile('Example work ndLogger class', __dirname + '/log/example.log', opt);
const ndLogger = new req(logToFile);
//const ndLogger = new req(logToConsole, logToFile);
//const ndLogger = new req(logToConsole);
con.float('Hello');
ndLogger.msg('Start application');

ndLogger.err('Error 1');

con.float('Hello 1');
logToConsole.off(err);
//logToFile.off(err);

con.float('Hello 2');
ndLogger.err('Error 2');

con.float('Hello 3');
ndLogger.msg('Stop application');

con.float('End');
```

Execute script on the command line

```bash
node example.js
```

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