expo-asset-utils
Utilities for converting files into Expo Assets
Last updated 3 years ago by tsapeta .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install expo-asset-utils 
SYNC missed versions from official npm registry.

expo-asset-utils

This package is no longer required for parsing assets, use expo-asset and expo-file-system instead.

expo-asset-utils

Installation

yarn add expo-asset-utils

Usage

Import the library into your JavaScript file:

import * as AssetUtils from 'expo-asset-utils';

Functions

resolveAsync

Given a reference to some asset, this will return a promise that resolves to an Expo.Asset that has been cached.

  • Expo asset: Expo.Asset.fromModule(require('./image.png'))
  • static resource: require('./image.png')
  • remote image: 'https://upload.wikimedia.org/wikipedia/en/1/17/Batman-BenAffleck.jpg'
  • local file: 'file:///var/image.png'
  • asset library file: 'asset-library:///var/image.png'
  • React Native Image source: {uri: 'https://upload.wikimedia.org/wikipedia/en/1/17/Batman-BenAffleck.jpg'}
Property Type Description
fileReference Expo.Asset, number, string, {uri: string} This will resolve into a downloaded Expo.Asset

base64forImageUriAsync

Given a image URI string, this will return a base64 encoded string and the image size: { data: string, size: { width: number, height: number } }

Property Type Description
uri string This URI will be converted to base64

uriAsync

Deprecated: Use (await resolveAsync()).localUri

fromUriAsync

Deprecated: Use Asset.fromURI('...') from expo-asset

arrayFromObject

Deprecated

cacheAssetsAsync

Deprecated

Current Tags

  • 3.0.0                                ...           latest (3 years ago)

15 Versions

  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4-alpha.3                                ...           6 years ago
  • 0.0.4-alpha.2                                ...           7 years ago
  • 0.0.4-alpha.1                                ...           7 years ago
  • 0.0.4-alpha.0                                ...           7 years ago
  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.0                                ...           7 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE