# @crherman7/react-native-asset

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

Latest version **0.0.1** (published 2022-08-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @crherman7/react-native-asset
pnpm add @crherman7/react-native-asset
yarn add @crherman7/react-native-asset
bun add @crherman7/react-native-asset
```

Provides the command `react-native-asset`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2022-08-29 |
| First published | 2022-08-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 24.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yuval Saraf |
| Maintainers | crherman7 |
| Keywords | react-native, react, native, js, asset, assets, link |

## Links

- npm: https://www.npmjs.com/package/@crherman7/react-native-asset
- Repository: https://github.com/crherman7/react-native-asset
- Homepage: https://github.com/crherman7/react-native-asset#readme
- Issues: https://github.com/crherman7/react-native-asset/issues
- npm.io page: https://npm.io/package/@crherman7/react-native-asset

## Dependencies (5)

- [plist](https://npm.io/package/plist.md) ^3.0.1
- [xcode](https://npm.io/package/xcode.md) ^2.0.0
- [npmlog](https://npm.io/package/npmlog.md) ^4.1.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [sha1-file](https://npm.io/package/sha1-file.md) ^1.0.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.1 (latest) — 2022-08-29

## README

# react-native-asset
[![npm version](https://badge.fury.io/js/react-native-asset.svg)](https://badge.fury.io/js/react-native-asset)[![Build Status](https://travis-ci.org/unimonkiez/react-native-asset.svg?branch=master)](https://travis-ci.org/unimonkiez/react-native-asset)

## Link and unlink assets to your react-native project with ease!

## 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`](https://github.com/zmxv/react-native-sound#basic-usage)) and `ttf` files.

### [Check out this starter-kit to use your assets with even more simplicity.](https://github.com/unimonkiez/react-platformula-boilerplate)

## Usage
* Install
  ```bash
  npm install -g react-native-asset
  # or yarn
  yarn global add react-native-asset
  ```
* Add assets to your `react-native.config.js` as you would with `react-native link`
  ```json
  ...
   "assets": [
      "./src/font",
      "./src/mp3"
    ]
  ```
* Run the command and linking + unlinking is automatic!
  ```bash
  react-native-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-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.

## Backward compatability
* to use react-native 0.59 and below, use version 1.1.4

---
_Source: https://npm.io/package/@crherman7/react-native-asset · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
