npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-ios-asset-exporter

v0.1.7

Published

test

Downloads

4

Readme

react-native-ios-asset-exporter

A helper module to retrieve media library assets

This is an iOS ONLY package.

API documentation

In order to use the library, import the function from the package:

import * as MediaHelperUtils from "media-asset-utils";

Note: Since the library only exports one function, you can also import it directly. However, there are return types that are extremely useful when parsing the return data in Typescript.

PhotoAssetErrors

0 = noAssetsFound 1 = destinationNotAccessible

PhotoAssetWarnings

0 = duplicateIdentifiersRemoved 1 = destinationFileAlreadyExists 2 = blacklistedExtension 3 = noDeletionNecesary

ExportedAssetResource

associatedAssetID (String): The Asset the resource is associated with

localFileLocations (String): The local file location of the resource

warning ([PhotoAssetWarnings]): An array of warnings that may have occurred during the export process specific to the resource

PhotoAssetResults

exportResults ([ExportedAssetResource]): An array of exported resources

errors ([PhotoAssetErrors]): An array of errors that may have occurred during the export process

general ([PhotoAssetWarnings]): An array of warnings that may have occurred during the export process in the general process

exportPhotoAssets

Exports all resources related to each asset in the media library.

This includes, but is not limited to:

  • Original File
  • Any Paired Videos or Photos (Live Photos)
  • Edited Versions of Each Resource by the User
  • All images related to the asset if it's a burst photo
  • etc

However, extra edited information such as plist files containing user edits are ignored unless specified in parameters.

Parameters

photoIdentifiers: [String]

  • Accepts a list of photo identifiers that will be used to retrieve the assets from the media library.

to: String

  • A specified folder that the assets will be exported to. If folder specified is invalid, the function will return an error.

withPrefix: String

  • A prefix that will be prepended to the exported file name. If no prefix is specified, the file name will be the same as the original file name.

shouldRemoveExistingFile: Boolean

  • A boolean value that determines whether or not the function should remove the existing file if it already exists in the specified folder. If set to false, the function will will NOT overwrite the existing file and provide a warning when attempting to retrieve the resource under the exportResults property of the return type.

ignoreBlacklist: Boolean

  • A boolean value that determines whether or not the function should ignore the blacklist of file extensions. If set to true, the function will export all file types regardless of whether or not they are blacklisted. (.plist files are specifically blacklisted by default)

callback: (PhotoAssetResults) => void

  • A callback function that will be called when the export process is complete. The function will return a PhotoAssetResults object.

Add the package to your npm dependencies

npm install react-native-ios-asset-exporter

Configure for iOS

Due to this being a native package, you probably need to run your project using

npx expo run:ios

after installing or it may cause JS bundling errors or other weird issues.

Contributing

Contributions are very welcome! Please make a pull request and I will review it as soon as possible.