JSPM

fit-with-aspect-ratio

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 32
    • Score
      100M100P100Q50017F
    • License MIT

    Package Exports

    • fit-with-aspect-ratio

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fit-with-aspect-ratio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    fit-with-aspect-ratio

    Installation

    yarn add fit-with-aspect-ratio

    Usage

    import fitWithAspectRatio from 'fit-with-aspect-ratio';
    
    const { width, height } = fitWithAspectRatio({
      originalWidth: 300,
      originalHeight: 400,
      maxWidth: 100,
      maxHeight: 30,
      minWidth: 10,
      minHeight: 10,
    })

    License

    The package is available as open source under the terms of the MIT License.