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

@fengzos/file-transfer

v0.1.1

Published

file-transfer

Readme

@fengzos/file-transfer

file-transfer

Install

npm install @fengzos/file-transfer
npx cap sync

iOS

To have files appear in the Files app, you must set the following keys to YES in Info.plist:

  • UIFileSharingEnabled (Application supports iTunes file sharing)
  • LSSupportsOpeningDocumentsInPlace (Supports opening documents in place)

Read about Configuring iOS for help.

Android

If using Directory.Documents or Directory.ExternalStorage, this API requires the following permissions be added to your AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Read about Setting Permissions in the Android Guide for more information on setting Android permissions.

Note that Directory.Documents and Directory.ExternalStorage are only available on Android 9 or older.

API

checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check read/write permissions. Required on Android, only when using Directory.Documents or Directory.ExternalStorage.

Returns: Promise<PermissionStatus>

Since: 1.0.0


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Request read/write permissions. Required on Android, only when using Directory.Documents or Directory.ExternalStorage.

Returns: Promise<PermissionStatus>

Since: 1.0.0


uploadFile(...)

uploadFile(options: UploadFileOptions) => Promise<UploadFileResult>

Uploads the specified file to the server URL provided using an HTTP multipart request.

| Param | Type | Description | | ------------- | --------------------------------------------------------------- | -------------------------------------------------- | | options | UploadFileOptions | UploadFileOptions |

Returns: Promise<HttpResponse>


downloadFile(...)

downloadFile(options: DownloadFileOptions) => Promise<DownloadFileResult>

Downloads a file form a given URL and saves it to the specified directory.

| Param | Type | Description | | ------------- | ------------------------------------------------------------------- | ------------------------------------------------------ | | options | DownloadFileOptions | DownloadFileOptions |

Returns: Promise<DownloadFileResult>


addListener('progress', ...)

addListener(eventName: 'progress', listenerFunc: ProgressListener) => Promise<PluginListenerHandle> & PluginListenerHandle

| Param | Type | | ------------------ | ------------------------------------------------------------- | | eventName | 'progress' | | listenerFunc | ProgressListener |

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

PermissionStatus

| Prop | Type | | ------------------- | ----------------------------------------------------------- | | publicStorage | PermissionState |

HttpResponse

| Prop | Type | | ------------- | --------------------------------------------------- | | data | any | | status | number | | headers | HttpHeaders | | url | string |

HttpHeaders

UploadFileOptions

| Prop | Type | Description | | ------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | url | string | The URL to upload the file to | | name | string | The field name to upload the file with | | blob | Blob | For uploading a file on the web, a JavaScript Blob to upload | | filePath | string | For uploading a file natively, the path to the file on disk to upload | | fileDirectory | Directory | Optionally, the directory to look for the file in. If this option is used, filePath can be a relative path rather than absolute |

DownloadFileResult

| Prop | Type | | ---------- | ------------------- | | path | string | | blob | Blob |

DownloadFileOptions

| Prop | Type | Description | | ------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | filePath | string | The path the downloaded file should be moved to | | fileDirectory | Directory | Optionally, the directory to put the file in If this option is used, filePath can be a relative path rather than absolute | | progress | boolean | Optionally, the switch that enables notifying listeners about downloaded progress If this option is used, progress event should be dispatched on every chunk received |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

ProgressStatus

| Prop | Type | | ------------------- | ----------------------------------------------------- | | type | ProgressType | | url | string | | bytes | number | | contentLength | number |

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

UploadFileResult

HttpResponse

ProgressListener

(progress: ProgressStatus): void

ProgressType

'DOWNLOAD' | 'UPLOAD'

Enums

Directory

| Members | Value | Description | Since | | --------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | | Documents | "DOCUMENTS" | The Documents directory On iOS it's the app's documents directory. Use this directory to store user-generated content. On Android it's the Public Documents folder, so it's accessible from other apps. It's not accesible on Android 10 unless the app enables legacy External Storage by adding android:requestLegacyExternalStorage="true" in the application tag in the AndroidManifest.xml. It's not accesible on Android 11 or newer. | 1.0.0 | | Data | "DATA" | The Data directory On iOS it will use the Documents directory. On Android it's the directory holding application files. Files will be deleted when the application is uninstalled. | 1.0.0 | | Library | "LIBRARY" | The Library directory On iOS it will use the Library directory. On Android it's the directory holding application files. Files will be deleted when the application is uninstalled. | 1.1.0 | | Cache | "CACHE" | The Cache directory Can be deleted in cases of low memory, so use this directory to write app-specific files that your app can re-create easily. | 1.0.0 | | External | "EXTERNAL" | The external directory On iOS it will use the Documents directory On Android it's the directory on the primary shared/external storage device where the application can place persistent files it owns. These files are internal to the applications, and not typically visible to the user as media. Files will be deleted when the application is uninstalled. | 1.0.0 | | ExternalStorage | "EXTERNAL_STORAGE" | The external storage directory On iOS it will use the Documents directory On Android it's the primary shared/external storage directory. It's not accesible on Android 10 unless the app enables legacy External Storage by adding android:requestLegacyExternalStorage="true" in the application tag in the AndroidManifest.xml. It's not accesible on Android 11 or newer. | 1.0.0 |