open-index/open-npm huggingface dataset:
npm package: @kotonosora-tech/date-utils
Description: A small tool calculator calendar in month
Author: Nguyễn Duy Thắng
Latest version: 1.0.12

<div align="center">
<h1>Date Utils</h1>

<p>
A small tool calculator calendar in month
</p>

[package]: https://www.npmjs.com/package/@kotonosora-tech/date-utils
[version-badge]: https://img.shields.io/npm/v/@kotonosora-tech/date-utils
[license]: https://github.com/KotonoSora/date-utils/blob/master/LICENSE
[license-badge]: https://img.shields.io/github/license/KotonoSora/date-utils?color=b

[![version][version-badge]][package]
[![MIT License][license-badge]][license]

</div>

<hr />

<details><summary>Table of Contents</summary><p>

- [Installation](#installation)
- [Features](#features)
  - [Get Key Month](#get-key-month)
  - [Get Page Month](#get-page-month)
- [Authors](#authors)
- [LICENSE](#license)
</p></details>

## Installation

```shell
npm install @kotonosora-tech/date-utils --save
# or with yarn
yarn add @kotonosora-tech/date-utils
```

## Features

### Get Key Month

> Return from date, to date available of month by select day, month start date, action change start date and holidays in a round year

```javascript
getKeyMonthFromToDate(param);
```

<details><summary>Example:</summary><p>

```javascript
import { getKeyMonthFromToDate, DateKeyFormat, MonthlyStartDateAction } from '@kotonosora-tech/date-utils';

const holidays: string[] = [
  '2020-01-01',
  '2020-04-30',
  '2020-05-01',
  '2020-09-02',
]

const result = getKeyMonthFromToDate(
  new Date(),
  1,
  MonthlyStartDateAction.NoChange,
  holidays
);

/**
{
  keyMonth: '2022-07-01-2022-07-31',
  fromDate: '2022-07-01',
  toDate: '2022-07-31'
}
* /
```
</p></details>

### Get Page Month

> Return list string format `YYYY-MM-DD` of page calendar by first day of week, from and to date

```javascript
getPageMonth(param: IPageMonth): string[]
```

<details><summary>Example:</summary><p>

```javascript
import {getPageMonth, FIRST_DAY_OF_WEEK} from "@kotonosora-tech/date-utils";

let result: string[] = getPageMonth(
  FIRST_DAY_OF_WEEK.MONDAY,
  new Date(2020, 6, 10),
  new Date(2020, 7, 5)
);

/**
result = [
  '2020-06-08',
  '2020-06-09',
  ...
  '2020-07-11',
  '2020-07-12'
];
* /
```
</p></details>

## Authors
[Nguyễn Duy Thắng](https://kotonosora.dev)

## License
[MIT](LICENSE)
npm package: @kotorik/palette
Description: Color Quantiliaztion in vanilla Javascript for browser/Nodejs, powered by an optimized k-means algorithm.
Author: KotoriK
Latest version: 3.0.4

# @kotorik/palette
Color Quantiliaztion in vanilla Javascript for browser/Nodejs, powered by an optimized k-means algorithm.
## Feature
### Quantilization
* Color quantilization powered by an optimized k-means algorithm. 
* Support RGBA
* Support transforming to CIE Lab before process.
### Bundle Size
* 4kB minfied ("color-space" not included)
* Support Tree Shaking
### Other
* Detailed Type definition
* Transform cluster result to CSS Text
* Work on Nodejs with ```node-canvas```
## Install
```
npm i --save @kotorik/palette
```
## Usage
```ts
import {toPixel,readImageDownsampling,kmeans} from '@kotorik/palette'
const img = document.getElementsByTagName('img')[0];
const imgData = toPixel(readImageDownsampling(img, 100 * 1000))
/**
 * transform to CIE LAB, this method only support sRGB 8-bit source image for now.
 * However you can make your own tranform method for other format and color space,
 * and pass a 'Vector4' to the function
*/
//const imgData = toPixelLAB(readImageDownsampling(img, 100 * 1000))
const result:KMeansResult = kmeans(imgData, k, attempt,thresold)

interface KMeansResult {
    /**centroids of each cluster */
    centroid: Vector4[],
    /**how many times iterated before the model fitted*/
    iteration: number,
    /**is model fitted within iteration*/
    fit: boolean,
    /**how many pixels does each cluster has*/
    label: number[]
    /**how many pixels does the input image has */
    size: number
}
```
see ```example/app.ts``` for more.