# phonegap-assets

> Generate phonegap assets based on the config.xml file. And icon generator for ios / android

Latest version **2.2.1** (published 2021-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install phonegap-assets
pnpm add phonegap-assets
yarn add phonegap-assets
bun add phonegap-assets
```

Provides the commands `phonegap-assets`, `phonegap-assets-icon`, `phonegap-assets-splash`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2021-05-05 |
| First published | 2018-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 89.1 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | Joel Chu |
| Maintainers | joelchu |
| Keywords | phonegap, cordova, icons, splash, android, ios, windows, wp8, blackberry, fireos, harmony os |

## Links

- npm: https://www.npmjs.com/package/phonegap-assets
- Repository: https://gitee.com:NEWBRAN/phonegap-assets
- Homepage: https://gitee.com/NEWBRAN/phonegap-assets#readme
- Issues: https://gitee.com/NEWBRAN/phonegap-assets/issues
- npm.io page: https://npm.io/package/phonegap-assets

## Dependencies (9)

- [meow](https://npm.io/package/meow.md) ^9.0.0
- [debug](https://npm.io/package/debug.md) ^4.3.1
- [sharp](https://npm.io/package/sharp.md) ^0.28.1
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.23
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.1.0
- [inquirer](https://npm.io/package/inquirer.md) ^8.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 2.2.1 (latest) — 2021-05-05
- 2.2.0 — 2021-05-05
- 2.1.0 — 2021-05-05
- 2.0.0 — 2021-05-02
- 2.0.0-beta.1 — 2021-05-02
- 1.0.0 — 2020-11-30
- 1.0.0-alpha.1 — 2018-10-13

## README

# phonegap-assets

This tool will take an image (1024*1024[min]) then generate a set of appropriate sizes icons for your Phonegap project. Also it creates splash screen images as well.

**Major change in V.2**

As of Version 2, the `phonegap-assets` becomes an interactive command line program. All the previous options will no longer apply.

And the core action that generate icon and splash now in two different command line program, `phonegap-assets-icon` and `phonegap-assets-splash`.

And since the creation of this tool, the landscape of mobile world has changed a lot. Now we only got two platforms left (well, sort of but many news things on the horizon like Harmony). And `cordova` / `phonegap` once again making breaking change to their `config.xml`. Instead of taking the `config.xml` we use a stock template (which include all the names and their sizes) as a map to generate icons and splash for you.

### Installation

It's recommended to install this globally

```sh
$ npm install phonegap-assets --global
```

## phonegap-assets

Just run it from command line:

```sh
$ phonegap-assets
```

Answer the questions (it will try to detect files it expects and fill out the default). And by the end you should have you icons / splash screen files.s

## phonegap-assets-icons

This one will only generate icons for ios / android (round / square).
It uses a stock `config.xml` file and use the sizes and name information.
If you use the default options, you will end up with two folders (ios/android) of resized images from your source icon file.  

### How to use it

```sh
$ phonegap-assets-icons /path/to/your/icon.png
```

It expects a square png images no smaller then 1024x1024.

Then on the same place where you execute this command, you will get two folders of images

### options

* dest (-d) where you want to put the generated images
* platform(-p) you can specify just one type of images (ios/android)
* round (-r) you can pass a float number to fine tune the round, default is `0.0833`

## phonegap-assets-splash

More or less the same like `phonegap-assets-splash`

```sh
$ phonegap-assets-icons /path/to/your/splash.png /path/to/where/you/export
```

Options are almost identical to `phonegap-assets-icon` except there is no `round` option.


## Using it programmatically with `assetsGeneratorApi` (V2.2)

You can include this method in your program:

```js
const { assetsGeneratorApi } = require('phonegap-assets')

assetsGeneratorApi(type, inputObj, outputObj)
    .then(result => {
        // do your things with your result 
    })
```

### `assetsGeneratorApi` parameters

* type (string) - "icon" or "splash"
* inputObj (object) - expected keys are: 'sourceFile' (required), 'type'
* outputObj (object) - expected keys are: 'destDir', 'quality', 'round', 'platform', 'flat'

And it will return a promise resolve the result array of output, or error when fail.

---

MIT (c) 2020 Joel Chu

---
_Source: https://npm.io/package/phonegap-assets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
