open-index/open-npm huggingface dataset:
npm package: @fvilers/simple-logger
Description: A simple but colored logger for NodeJS
Author: Fabian Vilers
Latest version: 3.0.0

# simple-logger

A simple but colored logger for NodeJS

## How to install

```
npm install @fvilers/simple-logger
```

or

```
yarn add @fvilers/simple-logger
```

## How to use

```
const logger = require('@fvilers/simple-logger');

// Log anything
logger.log('A string', { or: 'any object' }, 'even', new Date(), 'or a boolean', true);

// Log as warning
logger.warn('⚠️', 'Be careful');

// Log as error
logger.error('💣', 'Something went wrong!');
```

## How it works

The library exports a `Logger` singleton that can be used to write messages to **stdout** with `log()` and `warn()` while it writes to **stderr** with `error()`.

## Context

Sometimes, it's useful to add some context to the messages being logged. You can create your own instance of the `Logger` class and set its context. This will prefix every message with the specified context.

```
const { Logger } = require('@fvilers/simple-logger');
const logger = new Logger({ context: 'my logger' });

logger.log('Hey there!'); // This will output: [my logger] Hey, there!
```

## Timestamp

Sometimes, it's useful to add timestamp to the messages being logged. You can create your own instance of the `Logger` class and set it to prefix every message with the current timestamp.

```
const { Logger } = require('@fvilers/simple-logger');
const logger = new Logger({ timestamp: true });

logger.log('Hey there!'); // This will output: 2019-03-28T12:32:47.263Z Hey, there!
```
npm package: @fvilers/sort-array
Description: An helper function to sort array based on a property or a predicate
Author: Fabian Vilers
Latest version: 2.0.0

# @fvilers/sort-array

An helper function to sort array based on a property. An helper object to sort on nested properties is also provided.

## Installation

```
npm install @fvilers/sort-array
```

or

```
yarn add @fvilers/sort-array
```

# ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

## Usage

```ts
import { ArraySorter, sortArray } from "@fvilers/sort-array";

const letters = sortArray(
  [
    { letter: "delta" },
    { letter: "alpha" },
    { letter: "beta" },
    { letter: "gamma" },
    { letter: "epsilon" },
  ],
  "letter"
);
console.log(letters);

type TestObject = { a: { b: { c: number } } };

const objects = new ArraySorter<TestObject>([
  { a: { b: { c: 3 } } },
  { a: { b: { c: 5 } } },
  { a: { b: { c: 1 } } },
  { a: { b: { c: 2 } } },
  { a: { b: { c: 4 } } },
]).sort(["a", "b", "c"], "asc");
console.log(JSON.stringify(objects));
```

Will produce a new array containingIt will output:

```
[
  { letter: 'alpha' },
  { letter: 'beta' },
  { letter: 'delta' },
  { letter: 'epsilon' },
  { letter: 'gamma' }
]
[{"a":{"b":{"c":1}}},{"a":{"b":{"c":2}}},{"a":{"b":{"c":3}}},{"a":{"b":{"c":4}}},{"a":{"b":{"c":5}}}]
```
npm package: @fvilers/task
Description: A simple command line to-do manager
Author: Fabian Vilers
Latest version: 1.0.1

# task

A simple command line to-do manager

## Install

```
npm install -g @fvilers/task
```

## Usage

### Create a task

```
task add "Do the dishes"
```

### List tasks

#### Remaining tasks

```
task list
```

```
 1  🔲  Take out the trash
 2  🔲  Do the dishes
```

#### All tasks

```
task list --all
```

```
 1  🔲  Take out the trash
 2  🔲  Do the dishes
 3  ☑️  Have good time
```

### Update a task

```
task update 2 "Ask the kids to do the dishes"
```

### Mark a task as done

```
task done 1
```

### Mark a task as undone

```
task undone 1
```

### Delete a task

```
task delete 3
```

### Swap tasks

```
task swap 1 2
```

### Empty the task list

Warning, this action is irreversible but a confirmation prompt is displayed. The confirmation prompte can be bypassed with the `-f` o `--force` flag.

```
task reset
```

```
Are your sure you want to permanently delete 2 tasks (y/n)?
```

### Get informations about your task list

```
task infos
```

```
File location:    C:\Users\Fabian\tasks.json
Done tasks:       1
Remaining tasks:  2
Total tasks:      3
```
npm package: @fvilers/uniq-array
Description: An helper function to filter an array for uniqueness based on a property or a predicate
Author: Fabian Vilers
Latest version: 2.0.0

# @fvilers/uniq-array

An helper function to filter an array for uniqueness based on a property or a predicate

## Installation

```
npm install @fvilers/uniq-array
```

or

```
yarn add @fvilers/uniq-array
```

# ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

## Usage

```ts
import uniqArray from "@fvilers/uniq-array";

const array = uniqArray(
  [
    { letter: "alpha" },
    { letter: "beta" },
    { letter: "gamma" },
    { letter: "beta" },
    { letter: "alpha" },
  ],
  "letter"
);
console.log(array);
```

Will produce a new array containing

```ts
[{ letter: "alpha" }, { letter: "beta" }, { letter: "gamma" }];
```