open-index/open-npm huggingface dataset:
npm package: @nicolassarasin-pontico/plugin-date
Description: Un composant React de sélection de date simple et réutilisable
Author: nicolassarasin-pontico
Latest version: 1.5.0

# @niclassarasin-pontico/plugin-date

Un composant React simple pour choisir une date au format `MM/DD/YYYY`.

### Installation and configuration

```bash
npm install @niclassarasin-pontico/plugin-date
```
and after installation , Import this package where you want to use the calendar...

```bash
import PluginDate from './Components/PluginComponent/src/Plugin_date';
```

### Use it in this way...

```bash
<PluginDate label="Start Date" selectedDate={startDate} onChange={setStartDate}/>
```
npm package: @nicolassiufe/eslint-config
Description: yet another eslint config
Author: nicolassiu
Latest version: 1.0.0

# Yet another eslint config

## how to use

- In your project root directory, create a .eslintrc.js file

```javascript
module.exports = {
  "extends": "@nicolassiufe/eslint-config"
}
```

- Install eslint-config-haina

```bash
tnpm i -D @nicolassiufe/eslint-config eslint
```

- In your package.json, add a script

```json
{
  "scripts": {
    "lint": "eslint --fix --ext .js,.vue src"
  }
}
```

- Before you commit code, type **npm run lint** to check your code **OR** use husky to hook precommit ;-)
npm package: @nicolastoulemont/use-fetch
Description: Basic use-fetch utility hook for state-while-revalidate data fetching
Author: Nicolas Toulemont
Latest version: 0.1.5

# Use-form

This use-fetch utility hook implement state-while-revalidate data-fetching with a cache using sha-256 hashs of the request url and params as keys.

## Disclaimer

This is a work in progress tool and mainly aimed at my personal use accross my projects.

## Installation

```bash
npm install @nicolastoulemont/use-fetch
or
yarn add @nicolastoulemont/use-fetch
```

## Usage

- Basic usage

```typescript
import { useFetch } from '@nicolastoulemont/use-fetch';

export function BasicComponent() {
  const { response, loading, error, fetchy } = useFetch(
    '[DATA_SOURCE_URL]',
    fetchOptions
  );

  return (
    <div>
      <button onClick={fetchy}></button>
      {loading && <div>Loading...</div>}
      {response && <div>{JSON.stringify(response, null, 2)}</div>}
    </div>
  );
}
```

## Built with

- [tsdx](https://github.com/jaredpalmer/tsdx)
- [React](https://github.com/facebook/react)

## Versionning

This tool use [SemVer](http://semver.org/) for versioning.

## Licence

MIT
npm package: @nicolastoulemont/utilities
Description: Utilities functions for personal use.
Author: Nicolas Toulemont
Latest version: 0.5.0

# Utilities

This utilities functions aims to share and re-use useful typed utilities functions I came accross.

## Disclaimer

This is a work in progress tool and mainly aimed at my personal use accross my projects.

## Installation

```bash
npm install @nicolastoulemont/utilities
or
yarn add @nicolastoulemont/utilities
```

## Functions

#### Colors

- randomHex()

```typescript
function randomHex(): string;
```

- isHex()

```typescript
function isHex(hex: string): boolean;
```

- isRgb()

```typescript
function isRgb({ r: number, g: number, b: number }): boolean;
```

- hexToRgb()

```typescript
function hexToRgb(hex: string): { r: number; g: number; b: number };
```

- rgbToHex()

```typescript
function rgbToHex({ r: number, g: number, b: number }): string;
```

- colorBasedOnBg()

```typescript
function colorBasedOnBg(
  bgHex: string,
  lightColor: string,
  darkColor: string
): string;
```

#### Arrays

- flatten()

```typescript
function flatten<T>(deepArray: Array<T>): Array<T>;
```

- arrayToRecord()

```typescript
function arrayToRecord<T extends { [key: string]: any }>(
  array: Array<T>,
  key: string
): Record<string, T>;
```

#### Other Data structures

- Stack

```typescript
const stack = new Stack<T>()
stack.push(value: T): void
stack.pop(): T
stack.peek(): T
stack.clear(): void
stack.print(): void
stack.isEmpty(): boolean
stack.reverse(stack: Stack<T>): void
stack.sort(stack: Stack<T>): void
```

- Queue 

```typescript
const queue = new Queue<T>()
queue.enqueue(value: T): void
queue.dequeue(): T | null
queue.peek(): T | null
queue.clear(): void
queue.print(): void
queue.reverse(queue: Queue<T>): Queue<T>
```
- PriorityQueue 

```typescript
const pq = new PriorityQueue<T>()
pq.enqueue(value: T): void
pq.dequeue(): T | null
pq.peek(): T | null
pq.clear(): void
pq.print(): void
pq.reverse(queue: Queue<T>): Queue<T>
```

- LinkedList

```typescript
const list = new LinkedList<T>()
list.insertFirst(data: T)
list.insertLast(data: T)
list.insertAt(data: T, index: number)
list.getAt(index: number): T | null
list.removeAt(index: number)
list.clearList()
list.getListAsArray(): Array<T>
list.printList()
```

- HashTable

```typescript
const hashTable = new HashTable<T>(size:number)
hashTable.insert(key:string, value: T)
hashTable.get(key:string) T | null
hashTable.remove(key:string)
```

- Binary Search Tree

```typescript
const bst = new BST<T>()
bst.add(value: T): void
bst.getMin(): T | null
bst.getMax(): T | null
bst.find(value: T): Node<T> | null
bst.contains(): boolean
bst.remove(value: T): Node<T> | "Tree is empty" | null
```

#### Misc

- randomString()

```typescript
function randomString(): string;
```

## Built with

- [tsdx](https://github.com/jaredpalmer/tsdx)

## Versionning

This tool use [SemVer](http://semver.org/) for versioning.

## Licence

MIT
npm package: @nicolasyepes2004/daystack
Description: Este paquete está desarrollado sobre la libería DateJS, agregandole nuevos métodos
Author: Nicolas Yepes
Latest version: 1.0.1

## daystack

Este paquete está implementado sobre [dayjs](https://www.npmjs.com/package/dayjs) para añador a su funcionalidad, los siguientes métodos:

- formatDate
- isWeekend
- isValidDate

## install

```
npm install @nicolasyepes2004/daystack
```

## examples

```js
const daystack = require("daystack");
const response = daystack.formatDate(new Date(), "DD/MM/YYYY");
console.log(response, "response");

const isValid = daystack.isValid(new Date());
console.log(isValid, "isValid");

const isWeekend = daystack.isWeekend(new Date());
console.log(isWeekend, "isWeekend");
```
npm package: @nicolawealth/array_to_object
Description: ![Tests Passing](https://github.com/NicolaWealth/array_to_object/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Farray_to_object%2Fraw%2Fmain%2Fcodec
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/array_to_object/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Farray_to_object%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `array_to_object` package transforms a string array into an object with string keys and boolean values.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `array_to_object` package with npm:

`npm install @nicolawealth/array_to_object`

# Interface
The package exports the function `arrayToObject(arr);` which takes in an optional string array argument and returns an object of key value pairs where the keys correspond to array entries and values are booleans initially set to true. If no value is provided to `arr` or if `arr` is undefined, an empty object will be returned.

# Testing
Tests can be found in `array_to_object.test.ts` located in `array_to_object/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/assert_nearly_equal
Description: ![Tests Passing](https://github.com/NicolaWealth/assert_nearly_equal/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fassert_nearly_equal%2Fraw%2Fmain
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/assert_nearly_equal/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fassert_nearly_equal%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `assert_nearly_equal` package asserts that a given numerical expected value and actual value are approximately equal.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `assert_nearly_equal` package with npm:

`npm install @nicolawealth/assest_nearly_equal`

# Usage
This package should be used for asserting or comparing floating point values which need not be exactly equal due to differences caused by rounding or truncating, but ensuring they are nearly equal (within an acceptable error bound).

# Interface
The package exports one function `assertNearlyEqual(actual, expected, errorMsg, epsilon)` where `actual` and `expected` are the two values to be compared. `errorMsg` is the string message which will be displayed if the assert fails. `epsilon` is the (inclusive) upperbound on the difference between the `actual` and `expected` values and is defaulted to `0.000001` if not specified. 

# Testing
Tests can be found in `assest_nearly_equal.test.ts` located in `asset_nearly_equal/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/base64_url
Description: ![Tests Passing](https://github.com/NicolaWealth/base64_url/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fbase64_url%2Fraw%2Fmain%2Fcodecov/badge.j
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/base64_url/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fbase64_url%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The purpose of this package is to provide functionality to encode and decode a Base64 string to a format such that it can be safely included in URLs by avoiding issues caused by Base64 use of reserved URL characters.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `base64_url.test.ts` package with npm:

`npm install @nicolawealth/base64_url`

# Usage
This package allows for safe transmitting and receiving Base64 data in web applications including but not limited to:
* Files
* Hash data
* Authentication tokens
* User data
* API responses

# Interface
The package exports functions `base64ToBase64Url(message)` and `base64UrlToBase64(message)`. 
* `base64ToBase64Url(message)`: used to encode a string `message` from a Base64 format to a Base64URL safe format by replacing all `+` with `-` and `/` with `_` and removing all trailing `=` (padding characters).
* `base64UrlToBase64(message)`: used to decode a string `message` from a Base64URL safe format to a Base64 format by replacing all `-` with `+` and `_` with `/` and adding appropriate `=` (padding characters).

# Testing
Tests can be found in `base64_url.test.ts` located in `base64_url.test.ts/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/chan_log
Description: ![Tests Passing](https://github.com/NicolaWealth/chan_log/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fchan_log%2Fraw%2Fmain%2Fcodecov/badge.json&
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/chan_log/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fchan_log%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `chan_log` package provides functionality for dynamic message logging based on provided channels (or flags).

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `chan_log` package with npm:

`npm install @nicolawealth/chan_log`

# Usage
The `chan_log` package is useful for selectively logging messages based on predefined categories and can be applied to the following cases:
* Debugging
* Error tracking
* Performance monitoring
* User activity tracking
* Audit trails
* Etc.

# Interface
The package exports function `chanLog(enabledFlags)` and it's type `chanLogType`. A `chanLogType` object should be created with the provided exported function where parameter `enabledFlags` is passed one of three things:
1) An array of strings which correspond to the enabled flags of messages to be logged. 
2) An empty array
3) Undefined

The `chanLogType` object consumes arguments of the form: `chanLogObject(flag, message)`, where both `flag` and `message` are string values. 
The logged messages can be accessed via the `log` property of the `chanLogType` object (`chanLogObject.log`). 
Initializing `chanLogObject` with either of `2)` or `3)` will result in a disabled logger such that `chanLogObject.log` is always an empty array regardless of messages passed to it. 
If `1)` is provided, any subsequent `message` provided to `chanLogObject(flag, message)` such that `flag` corresponds to an element of `enabledFlags` used to initialize `chanLogObject` will be added to `chanLogObject.log` as an array element. Any other `message` provided will be ignored.

# Testing
Tests can be found in `chan_log.test.ts` located in `chan_log/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/clamp
Description: ![Tests Passing](https://github.com/NicolaWealth/clamp/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fclamp%2Fraw%2Fmain%2Fcodecov/badge.json&query=
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/clamp/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fclamp%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `clamp` package provides functionality to force a given numerical value to be within a given range. 

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `clamp` package with npm:

`npm install @nicolawealth/clamp`

# Interface
The package exports the function `clamp(value, low, high, def)` where `low` and `high` define the acceptable range for `value` to be in. 
If `value` is `undefined` then it is reassigned to the value of `def` before clamping. If `value` is below the given range, it is reassigned to the value of `low` to clamp it.
If `value` is above the given range, it is reassigned to the value of `high` to clamp it.

# Testing
Tests can be found in `clamp.test.ts` located in `clamp/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/code_coverage_extractor
Description: ![Tests Passing](https://github.com/NicolaWealth/code_coverage_extractor/actions/workflows/auto_test_main_badge.yml/badge.svg)
Author: Nicola Wealth Inc
Latest version: 2.0.0

![Tests Passing](https://github.com/NicolaWealth/code_coverage_extractor/actions/workflows/auto_test_main_badge.yml/badge.svg)

# Introduction
The `Code Coverage Extractor` provides functionality to extract statement coverage for a given file(s) and output the data in a `Shields.io` dynamic endpoint badge format. 

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `Code Coverage Extractor` package with npm:

`npm install @nicolawealth/code_coverage_extractor`

# Usage
This package can be used in combination with `Shields.io` (or other badge generation tools) and GitHub actions workflows to provide a dynamic badge conveying up-to-date code coverage information on a GitHub or NPM `readme` file. Additional use cases exist for local statement coverage requirements.

# Setup & Configurations
Before the package can be used, you must have `mocha`and `nyc` setup and configured such that a `coverage-final.json` file is outputted in your coverage reporting script.

* `package.json` coverage reporting script example: `"cover:report": "nyc --reporter=text --reporter=json mocha -c"`

# Interface
The package provides the function `extractCoverage(coverageData, outputFile)` which consumes a `coverageData` file in a `.json` format (`coverage-final.json`) and an output file path which must also be a `.json` file. The package will compute statement coverage and output the resulting badge data, formatted to a `Shields.io` endpoint badge format as follows:

```
{
  "label": "Coverage",
  "message": "_%",
  "color": "(red, yellow, yellowgreen, green)"
}
```

where the `_` is replaced by the actual coverage value and the color changes to dynamically reflect the coverage value (red, yellow, yellowgreen, green).


# Testing
Tests can be found in `extract_coverage.test.ts` located in `code_coverage_extractor/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/defer_until
Description: ![Tests Passing](https://github.com/NicolaWealth/defer_until/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fdefer_until%2Fraw%2Fmain%2Fcodecov/badge
Author: Nicola Wealth Inc
Latest version: 0.1.2

![Tests Passing](https://github.com/NicolaWealth/defer_until/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fdefer_until%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction 
The `defer_until` package enables many functions to be added to a deferred stack, which can then be executed at any time.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `defer_until` package with npm:

`npm install @nicolawealth/defer_until`

# Usage
This package provides functionality to continuously add void functions with no arguments to a stack and then call the entire stack of functions at a later point.

In a simple use-case, a single function can be deferred to be called at a later point. In more complex cases, any number of functions can be added at a variety of points in the code to all be called at a later point simultaneously in last-in-first-out (LIFO) order.

After the stack is used to call all stored functions, the stack is emptied.

# Interface
The `defer_until` package provides the function `deferUntilFactory` which returns an instance of the object `deferUntilType` with the following properties:
- `defer(handler: () => void);` is used to pass handler functions which will be added to a stack of existing handler functions to all be called upon at a later time
- `later();` is used to call all the handler functions currently in the stack, following a LIFO convention, leaving the stack empty

# Testing
Tests can be found in `defer_until.test.ts` located in `defer_until/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/entries_ordered_by_key
Description: ![Tests Passing](https://github.com/NicolaWealth/entries_ordered_by_key/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fentries_ordered_by_key%2Fraw%
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/entries_ordered_by_key/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fentries_ordered_by_key%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `entries_ordered_by_key` package sorts an array of key-value pair objects with string keys, in lexicographical or reverse lexicographical order.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `entries_ordered_by_key` package with npm:

`npm install @nicolawealth/entries_ordered_by_key`

# Interface
The package exports two functions, `entitiesOrderedByKey(entries)` and `entitiesOrderedByKeyReversed(entries)` where `entries` is of the type `[key, value][]` i.e. is an array of key-value pair objects.
Here `key` is a string value. `entitiesOrderedByKey(entries)` will sort `entries` by lexicographical ordering and `entitiesOrderedByKeyReversed(entries)` will sort `entries` by reverse lexicographical ordering.

# Testing
Tests can be found in `entries_ordered_by_key.test.ts` located in `entries_ordered_by_key/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/error_to_string
Description: ![Tests Passing](https://github.com/NicolaWealth/error_to_string/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Ferror_to_string%2Fraw%2Fmain%2Fcodec
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/error_to_string/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Ferror_to_string%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `error_to_string` package provides functionality to convert a given error to a string.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `error_to_string` package with npm:

`npm install @nicolawealth/error_to_string`

# Usage
This package simplifies error handling in a variety of contexts, including but not limited to:
* Logging errors
* Displaying error messages
* Error reporting
* Debugging
* etc.

# Interface
The package exports the function `errorToString(e)` where `e` is the error provided. 
If `e` is an instance of type `Error` then the function will return a string in the format `errorName: message` where `errorName` and `message` correspond to the `name` and `message` properties of the `Error` object. 
If `e` is not an instance of type `Error` then the function will return the contents of `e` as a string.

# Testing
Tests can be found in `error_to_string.test.ts` located in `error_to_string/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/humanize_time
Description: ![Tests Passing](https://github.com/NicolaWealth/humanize_time/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fhumanize_time%2Fraw%2Fmain%2Fcodecov/b
Author: Nicola Wealth Inc
Latest version: 0.0.3

![Tests Passing](https://github.com/NicolaWealth/humanize_time/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fhumanize_time%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `humanize_time` package provides functionality to convert a time given in milliseconds to an intuitive, human-readable string format.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `humanize_time` package with npm:

`npm install @nicolawealth/humanize_time`

# Usage
The `humanize_time` package can be used to convert an exact time to a readable string format. This is useful for displaying time values in a user-friendly manner for: 
* a front-end user interface
* debugging and logging back-end code

# Interface
The package exports the function `humanizeTime(milliseconds)` which returns a readable string for the specified number of `milliseconds`:
1. Less than 1 second -> output: less than a second
2. Between 1 second and 1 minute -> output: x second(s)
3. Between 1 minute and 1 hour -> output: x minute(s)
4. More than 1 hour -> output: x hour(s) y minute(s)

# Testing
Tests can be found in `humanize_time.test.ts` located in `humanize_time/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/in_batches
Description: ![Tests Passing](https://github.com/NicolaWealth/in_batches/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fin_batches%2Fraw%2Fmain%2Fcodecov/badge.j
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/in_batches/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fin_batches%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `in_batches` package provides functionality for a given callback function to be applied (synchronously or asynchronously) to batches (of a specified size) of an iterable object.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `in_batches` package with npm:

`npm install @nicolawealth/in_batches`

# Usage
The 'in_batches' package allows for efficient processing of large data sets in manageable batches to optimize performance and handle asynchronous tasks effectively.

# Interface
The package exports the object `inBatches` with functions: `inBatches.sync(elements, size, callback)` and `inBatches.async(elements, size, callback)` which
behave in the same manner except that `inBatches.async` performs it's `callback` function calls asynchronously. Here `elements` is an iterable object (such as an array) and `size` refers to the desired batch size, i.e. the size of the groupings of `elements`.
`callback` refers to the function which will be applied to each batch of `elements` where `callback` is of the form  `(elements, batchNum) => void`. The `callback` function consumes a subset of `elements` and a `batchNum` (0, 1, 2, ...) and does not return anything.
If `size` does not evenly divide `elements`, the final batch will contain the remainder of `elements` after division by `size` and thus will contain less than `size` items.

# Testing
Tests can be found in `in_batches.test.ts` located in `in_batches/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/resolved_promise
Description: ![Tests Passing](https://github.com/NicolaWealth/resolved_promise/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fresolved_promise%2Fraw%2Fmain%2Fcod
Author: Nicola Wealth Inc
Latest version: 0.0.3

![Tests Passing](https://github.com/NicolaWealth/resolved_promise/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Fresolved_promise%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `resolve_promise` package provides utility for creating and managing promises that resolve with predefined values (`void`, `undefined`, & `boolean`), simplifying asynchronous operations.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `resolved_promise` package with npm:

`npm install @nicolawealth/resolved_promise`

# Interface
This package exports the object `resolvedPromise` with the following properties, all of which are promises resolved with specific values:
* `resolvedPromise.void`: a promise which resolves with `void`
* `resolvedPromise.undefined`: a promise which resolves with `undefined`
* `resolvedPromise.true`: a promise which resolves with `true`
* `resolvedPromise.false`: a promise which resolves with `false`

# Testing
Tests can be found in `resolved_promise.test.ts` located in `resolved_promise/src` and should be run with sinon, mocha and nyc.
npm package: @nicolawealth/time_it
Description: ![Tests Passing](https://github.com/NicolaWealth/time_it/actions/workflows/auto_test_main_badge.yml/badge.svg) ![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Ftime_it%2Fraw%2Fmain%2Fcodecov/badge.json&q
Author: Nicola Wealth Inc
Latest version: 0.0.2

![Tests Passing](https://github.com/NicolaWealth/time_it/actions/workflows/auto_test_main_badge.yml/badge.svg)
![Code Cov](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fnicolawealth%2Ftime_it%2Fraw%2Fmain%2Fcodecov/badge.json&query=%24.message&label=Code%20Coverage&color=%24.color)

# Introduction
The `time_it` package provides functionality to time the execution of a parameterless function.

# Installation
This package should be installed via npm. You must have npm installed first. The following can be run on the commandline to install the `time_it` package with npm:

`npm install @nicolawealth/time_it`

# Usage
The `time_it` package allows for logging the execution time of both synchronous and asynchronous functions which may be useful for the following scenarios:
* Testing code efficiency
* Logging execution times for analysis
* Optimizing code execution time
* Debugging slow functions
* etc.

# Interface
The package exports the object `timeIt` with functions: `timeIt.sync(func, logTime)` and `timeIt.async(func, logTime)` which behave in the same manner except for `timeIt.async(func, logTime)` handling asynchronous `func` arguments. Here `func` refers to the function you wish to execute and time and the result of `func` will be returned by `timeIt.sync(func, logTime)` and `timeIt.async(func, logTime)`.
`logTime` is a function meant to log the recorded execution time in microseconds and should be of the form: `(microseconds) => void`. `logTime` consumes one number, `microseconds` and does not return anything. A simple `logTime` implementation could work as follows:
```
let ms = 0;
const logTime = (microseconds: number): void => {
  ms = microseconds;
};
```
Using this `logTime` function, the execution time in microseconds would be stored in the variable `ms`.

# Testing
Tests can be found in `time_it.test.ts` located in `time_it/src` and should be run with sinon, mocha and nyc.
npm package: @nicolaz/babel-preset-hamal
Description: Babel preset used by Hamal
Author: NZ
Latest version: 0.1.2
Deprecated: 已迁移到 @hammal/babel-preset-app

# babel-preset-hamal

## Usage

### Install

```
npm i --save-dev @nicolaz/babel-preset-hamal
```

### babelrc

```
{
  "presets": [
    "@nicolaz/babel-preset-hamal"
  ]
}
```

默认选项：`{ react: true, debug: false }`。

默认已开启 `react-hot-loader`，项目使用时需要导入 [react-hot-loader](https://github.com/gaearon/react-hot-loader#getting-started)  到入口模块的顶部，**`npm link` 调试时需要独立安装**。

如果为非 React 项目，可以关闭 `react` 选项来移除 `preset-react` 和相关插件。

```
{
  "presets": [
    ["@nicolaz/babel-preset-hamal", {"react": false}]
  ]
}
```

开启 `debug` 参数，可以打开 `preset-env` 的 debug 选项，根据 [browserslist](https://github.com/browserslist/browserslist)  配置，在编译时会输出导入的 corejs 模块等信息。

## 内置的 presets 和 plugins

### presets

[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env)

[@babel/preset-react](https://babeljs.io/docs/en/babel-preset-react)

### plugins

[@babel/plugin-proposal-class-properties](https://babeljs.io/docs/en/babel-plugin-proposal-class-properties)

[@babel/plugin-transform-runtime](https://babeljs.io/docs/en/babel-plugin-transform-runtime)

## Polyfill

需要手动在项目入口顶部导入 `core-js/stable` 和 `regenerator-runtime/runtime`。安装该 preset 时，已包含这 2 个模块，直接导入即可。

```js
import 'core-js/stable';
import 'regenerator-runtime/runtime';
```

**在 `npm link ` 调试时需要独立安装**。

考虑到对项目的完整编译和适配浏览器目标，`preset-env` 的 `useBuiltIns` 选项使用了 `entry`。`usage` 固然很好，可以按需导入 corejs，但可能会忽略安装在 `node_modules` 下的第三方模块的适配，除非第三方模块已经完全考虑了这种情况。

## Runtime

已开启，且包含 `@babel/runtime`。但未开启 `corejs` 选项，否则会完全转换 ES6+ 的所有 API 为沙盒模式，而不是根据 browserslist。

## Debug & Publish

```
npm link

# in project directory
npm link @nicolaz/babel-preset-hamal

# publish
# 1
npm version <major|minor|patch>

# 2
npm publish --access=public
```
npm package: @nicolaz/eslint-config-hamal
Description: ESLint configuration used by Hamal
Author: NZ
Latest version: 0.1.2
Deprecated: rename to eslint-config-nicolaz

# eslint-config-hamal

## Usage

### Install

```
npx install-peerdeps --dev @nicolaz/eslint-config-hamal
```

### eslint config file

```
{
  "extends": "@nicolaz/eslint-config-hamal"
}
```

## 支持实验性的 ES6+ 语法特性检查

### Install `babel-eslint` 

```shell
npm install --save-dev babel-eslint
```

### eslint config file

```diff
{
  "extends": "@nicolaz/eslint-config-hamal",
+ "parser": "babel-eslint"
}
```
npm package: @nicolaz/eslint-config-hamal-base
Description: ESLint configuration used by Hamal
Author: NZ
Latest version: 0.3.5
Deprecated: rename to eslint-config-nicolaz-base

# eslint-config-hamal-base

## Usage

### Install

```
npx install-peerdeps --dev @nicolaz/eslint-config-hamal-base
```

### eslint config file

```
{
  "extends": "@nicolaz/eslint-config-hamal-base"
}
```

## 支持实验性的 ES6+ 语法特性检查

### Install `babel-eslint` 

```shell
npm install --save-dev babel-eslint
```

### eslint config file

```diff
{
  "extends": "@nicolaz/eslint-config-hamal-base",
+ "parser": "babel-eslint"
}
```

### eslint-plugin-vue

如果你安装了 `eslint-plugin-vue` 来检查你的 Vue 项目，你需要修改上面的 `parser` 选项。

因为该插件依赖 `vue-eslint-parser` 来解析 `*.vue ` 文件，如果重写了 `parser` 选项，就会导致该插件无法工作，参见：[eslint-plugin-vue 用户手册](https://eslint.vuejs.org/user-guide/#usage)

```diff
{
  "extends": [
    "@nicolaz/eslint-config-hamal-base",
 	  "plugin:vue/recommended"
  ],
- "parser": "babel-eslint",
  "parserOptions": {
+   "parser": "babel-eslint",
    "sourceType": "module"
  }
}
```
npm package: @nicolaz/hamal
Description: NZ's boilerplate generator based on Command-line interface
Author: NZ
Latest version: 0.9.1
Deprecated: rename to @hammal/cli

# Hamal

## Install

```shell
npm install -g hamal
```

## Usage

```
Usage: hamal <command>

Options:
  -v, --version                              output the version number
  -h, --help                                 output usage information

Commands:
  create <project-name>                      generate a new project from a template
  list|ls                                    list available templates
  add <template> <repository> [description]  add one custom template
  del <template>                             delete one custom template
```

## Templates

```
pure-mpa ---------------- nicolaszhao/pure-mpa-boilerplate
react-mpa --------------- nicolaszhao/react-mpa-boilerplate
react-spa --------------- nicolaszhao/react-spa-boilerplate
react-redux-spa --------- nicolaszhao/react-redux-spa-boilerplate
vue-spa ----------------- nicolaszhao/vue-spa-boilerplate
library ----------------- nicolaszhao/library-boilerplate
react-components-library  nicolaszhao/react-components-library-boilerplate
```

You can add custom templates locally.

## hamal-service project

`pure-mpa`, `react-mpa`, `react-spa`, `react-redux-spa`.

## browserslist

All projects will set [browserslist](https://github.com/browserslist/browserslist) config in `package.json`:

```
{  
  ...
  "browserslist": {
    "production": [
      "> 1%",
      "last 5 versions",
      "ie 11"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
```

## ESLint

All projects have ESLint, you can remove ESLint by terminal inquirer.
npm package: @nicolaz/qrcode
Description: A QRCode generator Based on JavaScript
Author: NZ
Latest version: 2.0.4

# @nicolaz/qrcode

跨浏览器的 JavaScript 版 QRCode 生成库。Fork 自 [QRcode](https://github.com/davidshimjs/qrcodejs)，使其支持 ESM 环境。

## 安装

```
npm i @nicolaz/qrcode
```

## 使用

````js
import QRCode from '@nicolaz/qrcode';
````

### 原生 JavaScript 中

````js
new QRCode(document.getElementById('qrcode'), 'http://www.baidu.com');
````

### React

```react
function QRCode({ url }) {
  const el = useRef(null);
  useEffect(() => {
    new QRCode(el.current, url);
  }, []);

  return (
    <div ref={el} className="qrcode" />
  );
}
```

## API

### 构造函数参数

#### Element

**Type:** HTMLElement | String

如果是 `String` 则认为是元素的 ID 选择器

#### Options

**Type:** Object | String

如果是 `Object` 则认为是一个配置对象：

| 属性         | 描述          | 默认值                  |
| ------------ | ------------- | ----------------------- |
| text         | QRCode 数据源 |                         |
| width        | 渲染宽度      | 256                     |
| height       | 渲染高度      | 256                     |
| colorDark    | 前景色        | `"#000000"`             |
| colorLight   | 背景色        | `"#ffffff"`             |
| correctLevel | 容错级别      | `QRCode.correctLevel.H` |

##### QRCode.correctLevel

* QRCode.correctLevel.L
* QRCode.correctLevel.M
* QRCode.correctLevel.Q
* QRCode.correctLevel.H

### 实例方法

#### qrcode.clear()

清除 QR code

#### qrcode.makeCode(text)

重新渲染另一个 QR code

## License

[MIT](https://github.com/nicolaszhao/qrcode/blob/master/LICENSE) © [nicolaszhao](https://github.com/nicolaszhao)
npm package: @nicolaz/soundbox
Description: A html5 Audio player core
Author: NZ
Latest version: 2.0.0

# @nicolaz/soundbox

HTML5 Audio 的高级封装，并拥有可添加和控制多个音频的能力。

## 快速上手

### 安装

```
npm i @nicolaz/soundbox
```

### 使用

```js
import Soundbox from '@nicolaz/soundbox';

const soundbox = new Soundbox();
const sound = soundbox.add({ src: /*AUDIO_URL*/ });
sound.play();
```

## API

### Soundbox

#### add( soundData )

**soundData:** [Object]

音频数据，比如：

```
{
  src: "...",
  volume: 50,
}
```

执行 `add` 方法后，返回一个 `sound` 对象。

#### remove( sound )

**sound:** [Sound]

通过 `add` 方法生成的对象。删除成功，返回 `soundbox` 中音频对象列表的索引，否则返回 `-1`。

#### reset()

重置 `soundbox`，这会清理所有 `add` 的 `sound`。

#### destroy()

`soundbox` 不再使用，调用后 `soundbox` 不再工作。如你要重新使用，需要重新 `new` 一个实例。

### Sound

通过 `soundbox.add` 返回的对象，执行 `soundbox.add` 时，可传入如下属性：

* **src:** 音频地址
* **volume:** 音频音量
* **muted:** 音频是否静音
* **range[Array]:** 包含 2 个时间值的数组 `[start, end]`，表示一个音频在时间轴上可播放的范围

#### play()

非同一个 `sound` 执行 `play`，会触发 `start` 事件

#### pause()

非播放中的 `sound` 执行无效

#### setPosition( time )

**time:** [Number]|秒

设置播放进度，如果为当前播放音频，会触发 `positionchange` 事件。没 `play` 过的 `sound` 执行无效，你也不应该为非播放中的 `sound` 设置播放进度，可在外部通过 `state` 来判断处理。

#### setMute( muted )

**muted:** [Boolean]

设置是否静音

#### setVolume( volume )

**volume:** [Number]|0-100

### Sound Events

通过 `sound` 对象的 `on(type, handler)` 方法绑定

#### progress

缓冲进度变化时触发

**handler( bufferedProgress )** 

**bufferedProgress:** [Number]|0-1

#### start

新音频/音频切换，并开始播放时触发

**handler( data )**

**data:** [Object]|{ duration }

#### statechange

音频状态更新时触发

**handler( state )**

**state:** [String]

见下方的 `STATES`

#### positionchange

音频时间进度更改时触发

**handler( currentTime, playedProgress )**

**currentTime:** [Number]

当前播放的时间

**playedProgress:** [Number]|0-1

#### error

音频播放错误时触发

**handler( Error )**

### STATES

直接从安装包导入:

```js
import { STATES } from '@nicolaz/soundbox'
```

`STATES` 包含以下属性：

* `PREBUFFER`: 'waiting'

* `BUFFERING`: 'loadeddata'

* `PLAYING`: 'playing'

* `PAUSE`: 'pause'

* `STOP`: 'suspend'

* `END`: 'ended'

## Demo

这里有一个 React 组件的示例：[Demo](./demo.js)

## LICENSE

[MIT](https://github.com/nicolaszhao/soundbox/blob/master/LICENSE) © [nicolaszhao](https://github.com/nicolaszhao)
npm package: @nicoleffect/canvas-retina
Description: you can see the HD canvas
Author: Nicole Wong
Latest version: 1.0.1

# canvas-retina

you can see the HD canvas

## use for

[source1 -->](https://github.com/nicoleffect/point-plot)
[source2-->](https://github.com/nicoleffect/simple-circle-progress)

## examples

```
// html
<canvas id="canvas"></canvas>
```

```
// npm install @nicoleffect/canvas-retina
import canvasRetina from '@nicoleffect/canvas-retina'

const {
  pixelRatio, // value of devicePixelRatio / backingStore, if you need this
  ctx, // object of canvas dom getContext('2d'), if you need this
  rect // object of canvas dom getBoundingClientRect(), if you need this
} = canvasRetina(document.getElementById('canvas'))

```

```
// or
<script src="https://nicoleffect.github.io/canvas-retina/dist/canvas-retina.iife.min.js"></script>
<script>
canvasRetina(document.getElementById('canvas'))
...
</script>
```

## all modes

```
amd、cjs、es、iife、umd
```
npm package: @nicoleffect/circle-progress
Description: a simple circe progress
Author: Nicole Wong
Latest version: 1.0.1

# circle-progress

a simple circe progress

[demo -->](https://nicoleffect.github.io/circle-progress/examples/index.html)

## usage
```
const circle = circleProgress ({
  canvas,
  isAnim = true, // default, click the circle to trigger animation
  rate, // number
  clockwise,
  dash,
  lineCap,
  circleStyle = '#000000', // default
  lineWidth = 10, // default
  orbitStyle = '',
  textStyle = '#000000', // default
  textBaseline = 'middle' // default
})

// plus

circle.onComplete(()=>{
  // progress done
})

// you can click the circle to trigger animation or do this
circle.anim() // trigger animation

```
## examples

![demo](https://nicoleffect.github.io/circle-progress/examples/img/example.png)

```
// npm install @nicoleffect/circle-progress
import circleProgress from '@nicoleffect/circle-progress'

circleProgress({
  canvas: document.getElementById('canvas0'),
  rate: 80
})

circleProgress({
  canvas: document.getElementById('canvas1'),
  rate: 76,
  orbitStyle: '#ffffff',
  circleStyle: '#2879ff'
})

circleProgress({
  canvas: document.getElementById('canvas2'),
  rate: 88,
  circleStyle: '#ffd50a',
  dash: true,
  orbitStyle: '#ffffff',
  textBaseline: 'alphabetic'
});

circleProgress({
  canvas: document.getElementById('canvas3'),
  rate: 82,
  circleStyle: '#84d276',
  textStyle: '#E57373',
  clockwise: true,
  textBaseline: 'hanging'
})

circleProgress({
  canvas: document.getElementById('canvas4'),
  rate: 78,
  circleStyle: '#E57373',
  textStyle: '',
  lineCap: 'round',
  lineWidth: 18
})

```
```
// or
<script src="https://nicoleffect.github.io/circle-progress/dist/circle-progress.iife.min.js"></script>

circleProgress({
  canvas: document.getElementById('canvas0'),
  rate: 80
})
```
## all modes

```
amd、cjs、es、iife、umd
```
npm package: @nicoleffect/dynamic-particles
Description: dynamic particles, connect dots line
Author: Nicole Wong
Latest version: 1.0.2

# dynamic-particles

dot and line, dots to dots connect

[demo1 -->](https://nicoleffect.github.io/dynamic-particles/examples/index.html)
[demo2 -->](https://nicoleffect.github.io/dynamic-particles/examples/index2.html)

## examples

```
// html
<canvas id="canvas"></canvas>
```

```
// npm install @nicoleffect/dynamic-particles
import dynamicParticles from '@nicoleffect/dynamic-particles'

 dynamicParticles({
  canvas: document.getElementById('canvas'), // required
  distance: 80, // 80px, default,distance from dot to dot
  dotColor: 'rgba(255, 255, 255, 0.8)', // or #000000
  dotRadius: 3, // 3px, default
  lineWidth：1, // 1px, default
  lineColor: 'rgba(255, 255, 255, 0.8)‘, // default as dotColor
  isConnect: true, // default, if you don't need lines, set it false
  isOnClick: true, // default, event for click or touchstart
  isOnMove: true // default
 })

```

```
// or

<script src="https://nicoleffect.github.io/dynamic-particles/dist/dynamic-particles.iife.min.js"></script>
<script>
dynamicParticles({ canvas: document.getElementById('canvas') })
</script>
```

## all modes

```
amd、cjs、es、iife、umd
```
npm package: @nicollguarnizo/streak-counter
Description: a streak counter for the browser, inspired by Duolingo.
Author: Nicoll
Latest version: 0.0.1

# streak-counter
a streak counter for the browser, inspired by Duolingo.

# `@jsjoeio/streak-counter` - a basic streak counter

This is a basic streak counter - inspired by Duolingo - written in TypeScript and meant for the browser (uses `localStorage`).

## Install

```shell
yarn add @jsjoeio/streak-counter
```

```shell
npm install @jsjoeio/streak-counter
```

### Usage

```typescript
import { streakCounter } from "@jsjoeio/streak-counter";

const today = new Date();
const streak = streakCounter(localStorage, today);
// streak returns an object:
// {
//    currentCount: 1,
//    lastLoginDate: "11/11/2021",
//    startDate: "11/11/2021",
// }
```
npm package: @nicolo-ribaudo/babel-runtime-es-shims
Description: babel's modular runtime helpers with es-shims polyfilling
Author: Nicolò Ribaudo
Latest version: 0.1.0

# @nicolo-ribaudo/babel-runtime-es-shims

> babel's modular runtime helpers with es-shims polyfilling

## Install

Using npm:

```sh
npm install --save @nicolo-ribaudo/babel-runtime-es-shims
```

or using yarn:

```sh
yarn add @nicolo-ribaudo/babel-runtime-es-shims
```
npm package: @nicolo-ribaudo/chokidar-2
Description: A wrapper around chokidar@2 to be able to specify both @2 and @3 as dependencies
Author: Nicolò Ribaudo
Latest version: 2.1.8-no-fsevents.3

# `@nicolo-ribaudo/chokidar-2`

A wrapper around `chokidar@2.1.8` that doesn't depend on `fsevents@1`.
npm package: @nicoloso100/react-native-awesome-module
Description: test
Author: Nicolás Angarita Ortiz
Latest version: 0.1.0

# react-native-awesome-module

test

## Installation

```sh
npm install react-native-awesome-module
```

## Usage

```js
import AwesomeModule from "react-native-awesome-module";

// ...

const result = await AwesomeModule.multiply(3, 7);
```

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT