Socket
Socket
Sign inDemoInstall

react-native-copy-asset

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-copy-asset

Linking and unlinking of assets in your react-native app, works for fonts and sounds


Version published
Weekly downloads
170
decreased by-32.81%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-copy-asset

npm version CircleCI

Advantages

  • react-native link only supports font files, this tool supports all assets.
  • Unlinking is automatic when you delete an asset, with react-native link, you need to unlink the files manually.
  • Proper link (and unlink) for mp3 (to use with react-native-sound) and ttf files.

Check out this starter-kit to use your assets with even more simplicity.

Usage

  • Install
    npm install -g react-native-copy-asset
    # or yarn
    yarn global add react-native-copy-asset
    
  • Add assets to your react-native.config.js as you would with react-native link
    ...
     "assets": [
        "./src/font",
        "./src/mp3"
      ]
    
  • Run the command and linking + unlinking is automatic!
    react-native-copy-asset
    

Explanation

With react-native link you have to unlink the files manually, which is hard work.
Instead this library writes link-assets-manifest.json to the root of android and ios folders to keep track of the files which it added, for later removing it for you if missing from your assets!

Parameters

  • -p, --path - path to project, defaults to cwd.
  • -a, --assets - assets paths, for example react-native-copy-asset -a ./src/font ./src/mp3.
  • -ios-a, --ios-assets - ios assets paths, will disable android linking
  • -android-a, --android-assets - android assets paths, will disable ios linking.
  • -n-u, --no-unlink - Not to unlink assets which not longer exists, not recommanded.

Keywords

FAQs

Package last updated on 15 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc