This package has been deprecated

Author message:

Deprecated in favor of more refined tools for optimizing hosted images. Squoosh and imagemin are both viable alternatives

expo-optimize

0.2.20 • Public • Published

👋 Welcome to
expo-optimize

Compress the assets in your project.

Circle CI


This library uses the natively powered package Sharp behind the scenes to optimally reduce your project's assets for use in an app or website.

👋 Notice: This package is not limited to Expo projects! This can be used with projects bootstrapped with community CLIs like ignite by Infinite Red, or react-native-cli by the React Native community.

🚀 Usage

# Run this once to install the sharp image processing utility.
# If this cannot be installed on your computer then you won't be able to optimize images.
npm install -g sharp-cli

# To optimize images simply run this
npx expo-optimize <project-directory> [options]

🤔 Why?

We created optimize to improve our docs and websites (Next, Gatsby, React), and our native apps (React & Expo). Optimizing images can noticeable improve your native app and website's TTI (or time-to-interaction) which means less time on splash screens and quicker delivery over poor network connections.

⚙️ Options

For more information run npx expo-optimize --help (or -h)

Shortcut Flag Input Description Default
-q --quality [number] The quality each image will attempt to be reduced to 80
-i --include [pattern] Include only assets that match this glob pattern relative to the project root expo.assetBundlePatterns: [] in the app.json
-e --exclude [pattern] Exclude all assets that match this glob pattern relative to the project root '**/node_modules/**', '**/ios/**', '**/android/**'
-s --save Save the original assets with a .orig extension
-h --help output usage information
-V --version output the version number

📚 Further Reading

Read more about how this package works here: Image compression in Expo projects.

Related

  • sharp - native image editing library for node
  • expo-cli - the original location for this command

License

The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.


License: MIT

Package Sidebar

Install

npm i expo-optimize

Weekly Downloads

1,665

Version

0.2.20

License

MIT

Unpacked Size

2.4 MB

Total Files

5

Last publish

Collaborators

  • szdziedzic
  • alanhughes
  • kadikraman
  • radoslawkrzemien
  • aleqsio
  • marklawlor
  • gabrieldonadel
  • simek
  • keith-kurak
  • christopherwalter
  • kbrandwijk
  • fiber-god
  • ide
  • brentvatne
  • evanbacon
  • quinlanj
  • expoadmin
  • tsapeta
  • exponent
  • wschurman
  • wkozyra
  • bycedric
  • lukmccall
  • jonsamp
  • princefleaswallow
  • kudochien