1.1.0 • Published 5 months ago

console-locale-timestamp v1.1.0

Weekly downloads
77
License
MIT
Repository
github
Last release
5 months ago

Console with locale timestamp

npm version Workflow status

Provides a console debugging facilities with a timestamp. Timestamps are written using Date.prototype.toLocaleTimeString().

All public methods have the same functionality as the Console.

Sample

JavaScript

import Console from 'console-locale-timestamp';

const console1 = new Console();
console1.debug('Hello World!');
console1.table({
	1001: { name: 'John Smith', age: '20' },
	1002: { name: 'Taro Yamada', age: '25' },
});

const console2 = new Console('en-US', { minute: '2-digit', second: '2-digit' }, ['[', ']'], ' - ');
console2.debug('Hello World!');
console2.table({
	1001: { name: 'John Smith', age: '20' },
	1002: { name: 'Taro Yamada', age: '25' },
});

Console

0:00:00 Hello World!
0:00:01
┌─────────┬───────────────┬──────┐
│ (index) │     name      │ age  │
├─────────┼───────────────┼──────┤
│  1001   │ 'John Smith'  │ '20' │
│  1002   │ 'Taro Yamada' │ '25' │
└─────────┴───────────────┴──────┘
[00:02] - Hello World!
[00:03]
┌─────────┬───────────────┬──────┐
│ (index) │     name      │ age  │
├─────────┼───────────────┼──────┤
│  1001   │ 'John Smith'  │ '20' │
│  1002   │ 'Taro Yamada' │ '25' │
└─────────┴───────────────┴──────┘

Constructor

constructor(locales?: string, options?: Readonly<Intl.DateTimeFormatOptions>, quote?: [string, string?], separator?: string)

Parameters

Methods

1.1.0

5 months ago

1.0.15

2 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago