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 🙏

© 2026 – Pkg Stats / Ryan Hefner

expo-sdcard-detector

v1.0.0

Published

Expo plugin to detect SD card storage paths on Android

Downloads

7

Readme

expo-sdcard-detector

An Expo config plugin and native module to detect SD card storage paths on Android devices. This module helps you access external storage paths, particularly useful for applications that need to interact with SD cards or external storage.

Features

  • 🔍 Detect all external storage paths on Android devices
  • 📱 Compatible with Expo and React Native projects
  • 🔧 Easy to integrate with existing Expo applications
  • 📦 TypeScript support included
  • 🛡️ Safe to use on iOS (returns empty array)

Requirements

  • Expo SDK 49 or higher
  • React Native 0.72 or higher
  • Android device with external storage support

Installation

npm install expo-sdcard-detector
# or
yarn add expo-sdcard-detector

Configuration

Add the plugin to your app.config.js or app.config.ts:

module.exports = {
  name: "my-app",
  plugins: ["expo-sdcard-detector"]
};

Usage

import { getExternalStoragePaths } from 'expo-sdcard-detector/native';

// Get all external storage paths
const paths = await getExternalStoragePaths();
console.log(paths);
// Example output on Android: ['/storage/emulated/0', '/storage/sdcard1']
// Example output on iOS: []

Example: Write to SD card

import { getExternalStoragePaths } from 'expo-sdcard-detector/native';
import * as FileSystem from 'expo-file-system';

const [sdPath] = await getExternalStoragePaths();       // e.g. "/storage/sdcard1/Android/data/…/files"
if (sdPath) {
  const fileUri = `file://${sdPath}/myFolder/hello.txt`;

  await FileSystem.makeDirectoryAsync(`file://${sdPath}/myFolder`, { intermediates: true });
  await FileSystem.writeAsStringAsync(fileUri, 'Hello SD-card!');

  const info = await FileSystem.getInfoAsync(fileUri);
  console.log(info);
}

Caveats / good to know

  • The function only returns paths for removable volumes; the internal storage path (/storage/emulated/0/…) is already available via FileSystem.documentDirectory.
  • iOS will always return an empty array ([]).
  • If you need to touch folders outside your app’s sandbox (e.g. the root of the SD-card or the user’s DCIM directory) you’ll have to use the Storage Access Framework (expo-storage-access-framework) or request the MANAGE_EXTERNAL_STORAGE permission on Android 11+, because Expo FileSystem alone may not bypass scoped-storage rules.

API Reference

getExternalStoragePaths()

Returns a Promise that resolves to an array of strings containing the paths to external storage devices.

  • Android: Returns an array of external storage paths (including SD card paths)
  • iOS: Returns an empty array []

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT