Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@4lch4/logger

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@4lch4/logger - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

18

package.json
{
"name": "@4lch4/logger",
"displayName": "Logger",
"version": "1.1.2",
"version": "1.2.0",
"description": "A small utility for logging to console within NodeJS/TypeScript applications.",
"main": "dist/index.js",
"scripts": {
"prepublish": "tsc",
"prepublishonly": "tsc",
"release": "np"
},
"keywords": [],
"keywords": [
"util",
"logger",
"log",
"logging",
"stdout"
],
"author": {

@@ -33,3 +39,4 @@ "name": "4lch4",

"chalk": "^4.1.0",
"dayjs": "^1.10.4"
"dayjs": "^1.10.4",
"fs-extra": "^9.1.0"
},

@@ -39,6 +46,3 @@ "devDependencies": {

"np": "^7.4.0"
},
"optionalDependencies": {
"fs-extra": "^9.1.0"
}
}

@@ -5,6 +5,23 @@ # @4lch4/logger

## Installation
The module is published to the NPM registry so you're able to install it as you would any other module:
```shell
# Using NPM
npm install --save @4lch4/logger
# Using Yarn
yarn add @4lch4/logger
# Using PNPM
pnpm install @4lch4/logger
```
## Usage
Using the logger is fairly straight forward. Once you've installed it you can import it and instantiate a new class to be used throughout your application:
Using the logger is fairly straight forward. Import the Logger, create a new instance with some optional properties, then use that instance throughout your application:
> **_NOTE: You can also create new instances throughout your app and it will log to the same files/locations._**
```typescript

@@ -24,9 +41,7 @@ import { Logger } from '@4lch4/logger'

<ul>
<li style="color: Cyan">debug - Cyan</li>
<li style="color: red">error - Red</li>
<li style="color: gray">info - Gray</li>
<li style="color: green">success - Green</li>
<li style="color: yellow">warn - Yellow</li>
</ul>
- debug - Cyan
- error - Red
- info - Gray
- success - Green
- warn - Yellow

@@ -33,0 +48,0 @@ If you provide a logDir when instantiating the Logger class, each level will have a file. For example, debug would be `2021.03.17-debug.log` whereas error would be `2021.03.17-error.log`.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc