2024-10-05 10:21:25 +00:00
|
|
|
# sharp-read-bmp
|
2024-10-05 11:14:45 +00:00
|
|
|
Function for reading bmp and ico and returning a sharp instance
|
2024-10-05 10:21:25 +00:00
|
|
|
|
2024-10-05 11:14:45 +00:00
|
|
|
Installation
|
|
|
|
----------------------------------------------------------------
|
|
|
|
```
|
|
|
|
npm install @valkyriecoms/sharp-read-bmp
|
|
|
|
```
|
|
|
|
|
|
|
|
Usage
|
|
|
|
----------------------------------------------------------------
|
|
|
|
|
|
|
|
```javascript
|
2024-10-06 11:01:35 +00:00
|
|
|
import { sharpBmp } from '@valkyriecoms/sharp-read-bmp';
|
2024-10-05 11:14:45 +00:00
|
|
|
import { fileTypeFromFile } from 'file-type';
|
|
|
|
|
|
|
|
const { mime } = await fileTypeFromFile('favicon.ico');
|
|
|
|
const sharpCtx = await sharpBmp('favicon.ico', mime);
|
|
|
|
|
|
|
|
console.log(await sharpCtx.metadata());
|
|
|
|
```
|