open-index/open-npm huggingface dataset:
npm package: @hec9527/image-compress
Description: image-compress is a tool to compress image by HTMLCanvasElement and HTML5 Api
Author: hec9527
Latest version: 1.0.4

# image-compress

image-compress is a tool to compress image by HTMLCanvasElement and HTML5 Api

## Usage

[online usage](https://image-compress-hec9527.vercel.app/)

### npm

```ts
import compress from 'image-compress';
const el = document.getElementById('file') as HTMLInputElement;

el.addEventListener('change', e => {
    const file: File = (e.target as any).files[0];
    if (!file) return;
    compress(file, { width: 1024 }).then(blob => {
        // upload blob or show blob localhost
    });
});
```

### umd

```html
<script src="path/to/index.umd.js"></script>
```

```js
const el = document.getElementById('file');

el.addEventListener('change', e => {
    const file: File = e.target.files[0];
    if (!file) return;
    compressImage(file, { width: 1024 }).then(blob => {
        // upload blob or show blob localhost
    });
});
```

## Arguments

compressImage function should receive two arguments

```js
compressImage(file, option);
```

### file

file is required, which should be `HTMLImageElement` or `File` object or `string` to load remote resource.

### option

option is optional

| attribute | type     | description                                                                                                                                              |
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| quality   | `number` | the output image quality, min 0, max 1, default is 0.9                                                                                                   |
| width     | `number` | the output image width, default is input image width. if height is set, but not width, it should be automatic calculation by origin image aspect ratio   |
| height    | `number` | the output image height, default is input image height. if width is set, but not height, is should be automatic calculation by origin image aspect ratio |
| mime      | `string` | the output image extension, default is jpeg                                                                                                              |
npm package: @hechang27/tree-magic-js-freebsd-x64
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-freebsd-x64`

This is the **x86_64-unknown-freebsd** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-linux-arm-gnueabihf
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-linux-arm-gnueabihf`

This is the **armv7-unknown-linux-gnueabihf** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-linux-arm64-musl
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-linux-arm64-musl`

This is the **aarch64-unknown-linux-musl** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-linux-x64-gnu
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-linux-x64-musl
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-linux-x64-musl`

This is the **x86_64-unknown-linux-musl** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-win32-arm64-msvc
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-win32-ia32-msvc
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-win32-ia32-msvc`

This is the **i686-pc-windows-msvc** binary for `@hechang27/tree-magic-js`
npm package: @hechang27/tree-magic-js-win32-x64-msvc
Description: Fast MIME type detection for Node.js, powered by Rust
Latest version: 1.1.6

# `@hechang27/tree-magic-js-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@hechang27/tree-magic-js`
npm package: @hechanglin/slate-react
Description: Tools for building completely customizable richtext editors with React.
Latest version: 0.117.1

This package contains the React-specific logic for Slate. It's separated further into a series of directories:

- [**Components**](./src/components) — containing the React components for rendering Slate editors.
- [**Hooks**](./src/hooks) — containing a few React hooks for Slate editors.
- [**Plugins**](./src/plugin) — containing the React-specific plugins for Slate editors.
- [**Utils**](./src/utils) — containing a few private convenience modules.

Feel free to poke around in each of them to learn more!
npm package: @heckle/cli
Description: CLI for Heckle
Author: Alex Gorischek
Latest version: 0.0.11

# Heckle CLI

CLI for [🤬 Heckle](https://www.npmjs.com/package/@heckle/health). To get started, see [`@heckle/health`](https://www.npmjs.com/package/@heckle/health).
npm package: @heckle/core
Description: Core functionality for Heckle
Author: Alex Gorischek
Latest version: 0.0.18

# Heckle Core

Core logic for [🤬 Heckle](https://www.npmjs.com/package/@heckle/health). To get started, see [`@heckle/health`](https://www.npmjs.com/package/@heckle/health).
npm package: @heckle/hosts
Description: Service host adapters for Heckle
Author: Alex Gorischek
Latest version: 0.0.10

# Heckle Hosts

Host adapters for [🤬 Heckle](https://www.npmjs.com/package/@heckle/health). To get started, see [`@heckle/health`](https://www.npmjs.com/package/@heckle/health).
npm package: @heckle/monitors
Description: Monitor adapters for Heckle
Author: Alex Gorischek
Latest version: 0.0.9

# Heckle Monitors

Monitor adapters for [🤬 Heckle](https://www.npmjs.com/package/@heckle/health). To get started, see [`@heckle/health`](https://www.npmjs.com/package/@heckle/health).