open-index/open-npm huggingface dataset:
npm package: @juniorcitizen/convert-to-png
Description: simple sharp.js wrapper library to resize images and convert to PNG format
Author: juniorCitizen
Latest version: 1.0.2

# Image to PNG Conversion Utility (@juniorcitizen/convert-to-png)

simple sharp.js wrapper to apply resize, adjust quality and png conversion to image files

## Installation

```bash
npm install --save @juniorcitizen/convert-to-png
```

## Usage

```javascript
const Converter = require('@juniorcitizen/convert-to-png')

// optional quality options
// https://sharp.pixelplumbing.com/en/stable/api-output/#png
const options = {
  compressionLevel: 5,
  quality: 50,
}

/*
 * 1. proportionally resized to be contained within 640x480 pixels
 * 2. quality manipulations (optional)
 * 3. output to specified path
 * 
 * note: images are not enlarged if they are already
 *       smaller than specified
 */
new Converter()
  .init('./fileName1.jpg', {xLimit: 640, yLimit: 480})
  .then(pngImage => pngImage.output('./fileName1.png', options))
  .catch(error => console.log(error))

/*
 * 1. resized to max width 320px and height resized proportionally
 * 2. no quality manipulations
 * 3. output to specified path
 */
new Converter()
  .init('./fileName2.jpg', {xLimit: 320})
  .then(pngImage => pngImage.output('./fileName2.png'))
  .catch(error => console.log(error))

/*
 * 1. no resize
 * 2. quality manipulations (optional)
 * 3. output to buffer
 */
new Converter()
  .init('./fileName1.jpg')
  .then(pngImage => pngImage.output(undefined, options))
  .then(buffer => {
    console.log(buffer)
    return Promise.resolve()
  })
  .catch(error => console.log(error))
```

## API

### **instance.init(filePath, [resizeLimits])**

    filePath: String - source file path

    resizeLimits: {[xLimit: Number], [yLimit: Number]}

### **instance.resize([xLimit], [xLimit])**

    xLimit: Number

    yLimit: Number

### **instance.output([filePath], [options])**

    filePath: String - destination file path

    options: Object - see sharp.js documentations

## Notes

1. Uses [lovell/sharp](https://www.npmjs.com/package/sharp) for
   the image operations, please see their doc for available
   [options](https://sharp.pixelplumbing.com/en/stable/api-output/#png).

2. EXIF information is stripped

3. image transparency is preserved

4. if only one limit is defined, the other dimension is proportionally resized

5. images are not enlarged if already are smaller than the specified dims on both x and y directions
npm package: @juniordev/routinejs
Description: Express inspired, Radix trie based super fast Nodejs router
Author: Zulfiqar Qureshi
Latest version: 2.4.0

![routinejs](docs/user/routinejs/static/img/RoutineJS-logos-cropped.jpeg 'RoutineJS')

Documentation: https://routine.juniordev.net/docs/intro