open-index/open-npm huggingface dataset:
npm package: @mesa-libs/dates
Description: This package is going to use dayjs library to standardly the way backends work with dates
Author: Mesa Mobile Thinking
Latest version: 1.0.5

[badge]: https://img.shields.io/badge/Author-Mesa%20Mobile%20Thinking-c21712.svg?style=flat-square

# Date Manager
[![Mesa Mobile Thinking][badge]](https://mesainc.com.br)

## Description

This library have to be used in backend projects to work with dates. It is going to standardize the way all projects work with dates. This libbrary uses dayjs to work with dates.

## How it works?

This library exports only one class with static methods, so the only thing you have to do is import the class and call its methods.

### Getting current date

This method returns the current date as an iso string

```js
import { DateManager } from '@mesa-libs/dates';

const currentate = DateManager.now();

console.log(currentate); // expected output: string with current date in iso 8601 format. Eg: 2019-01-25T02:00:00.000Z
```

### Getting a formatted date

This method returns the sent date with the format sent. If any format were sent the default format is going to be 'YYYY-MM-DD'.

```js
import { DateManager } from '@mesa-libs/dates';

const date = DateManager.formatDate('2023-12-21 23:34:01', 'DD-MM-YYYY HH:mm:ss');

console.log(date); // expected output: 21-12-2023 23:34:01


const date = DateManager.formatDate('2023-12-21', 'DD-MM-YYYY');

console.log(date); // expected output: 21-12-2023


const date = DateManager.formatDate('2023-12-21', 'DD-MM-YY');

console.log(date); // expected output: 21-12-23


const date = DateManager.formatDate('2023-12-21');

console.log(date); // expected output: 2023-12-21
```

### cheking if the sent date is expired

This method returns TRUE when a date is expired and false if the date is not expired.

```js
import { DateManager } from '@mesa-libs/dates';

// considering current date as 2024-01-01

// testing current date
const expired = DateManager.isExpired('2024-01-01');

console.log(expired); // expected output: FALSE


// testing a past date
const expired = DateManager.isExpired('2023-12-21');

console.log(expired); // expected output: FALSE


// testing a future date
const expired = DateManager.isExpired('2024-12-21');

console.log(expired); // expected output: TRUE
```
npm package: @mesa-libs/log
Description: This package is going to use winston to log messages in cloud watch
Author: Mesa Mobile Thinking
Latest version: 1.1.0

[badge]: https://img.shields.io/badge/Author-Mesa%20Mobile%20Thinking-c21712.svg?style=flat-square

# Log Manager
[![Mesa Mobile Thinking][badge]](https://mesainc.com.br)

## Description

This library have to be used in backend projects to write logs in cloud watch using the same log library (winston). It is going to standardize all project logs.

## How it works?

This library exports only one class with static methods, so the only thing you have to do is import the class and call its methods.

### Setting up a context

This method set up the context to be used in log messages.

```js
import { LogManager } from '@mesa-libs/log';

LogManager.setContext('context_name');
```

### Logging a INFO message

This method logs a message and metadata. It should be used to information logs in the code.

```js
import { LogManager } from '@mesa-libs/log';

LogManager.info('message');
```

### Logging a WARN message

This method logs a message and metadata. It should be used to warning logs in the code.

```js
import { LogManager } from '@mesa-libs/log';

LogManager.warn('message');
```

### Logging a ERROR message

This method logs a message and metadata. It should be used to error logs in the code.

```js
import { LogManager } from '@mesa-libs/log';

LogManager.error('message');
```

### Logging a DEBUG message

This method logs a message and metadata. It should be used to debug logs in the code.

```js
import { LogManager } from '@mesa-libs/log';

LogManager.debug('message');
```