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

nscl-logwriter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nscl-logwriter

Some logging and date-formatting code I've used multiple places.

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

nscl-logwriter

Some logging and date-formatting code I've used multiple places.

Versions

  • 1.0.3, 2020-08-17, AMV : First real publish.

Usage

Example:

const log = require('nscl-logwriter')(`/path/to/mylogfile.log`, 'My Log File');

log('Put a message string here.');
log('If you:\n- put multiple lines, then\n- you can put an optional indent level.', 4);
log('Watch this--' + JSON.stringify({a:1,b:2,c:3}, undefined, 2), 12);

const { goodDateAndTime } = require('nscl-logwriter');
log('Formatting a timestamp using goodDateAndTime:');
log(JSON.stringify(goodDateAndTime(1234567891011)));

Which outputs:

My Log File           Mon 8-17 6:59pm    1597708760955  |    Put a message string here.
My Log File           Mon 8-17 6:59pm    1597708760958  |    If you:
                                                        |        - put multiple lines, then
                                                        |        - you can put an optional indent level.
My Log File           Mon 8-17 6:59pm    1597708760959  |    Watch this--{
                                                        |                  "a": 1,
                                                        |                  "b": 2,
                                                        |                  "c": 3
                                                        |                }
My Log File           Mon 8-17 6:59pm    1597708760960  |    Formatting a timestamp using goodDateAndTime:
My Log File           Mon 8-17 6:59pm    1597708760960  |    ["Fri 2-13","5:31pm"]

Keywords

FAQs

Package last updated on 18 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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