Skip to content

SourceSprint/moment-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Package

Moment Logger

Fancy terminal logging with timestamps

Installing

Using npm:

$ npm install moment-logger

Using yarn:

$ yarn add moment-logger

Example

CommonJS Usage

In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with require() use the following approach:

const logger = require('moment-logger').default;

# Display hello world

logger.log('Hello world');

# Display world object

const worldObject = {
    earth: ['Water', 'Earth', 'Air', 'Fire']
};

logger.log(worldObject);

ES6 Usage

import logger from 'moment-logger';

# Display hello world

logger.log('Hello world');

# Display world object

const worldObject = {
    earth: ['Water', 'Earth', 'Air', 'Fire']
};

logger.log(worldObject);