# @eventstore-ui/icon-manager

> Automated icon inclusion for Event Store design system

Latest version **1.0.2** (published 2024-08-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @eventstore-ui/icon-manager
pnpm add @eventstore-ui/icon-manager
yarn add @eventstore-ui/icon-manager
bun add @eventstore-ui/icon-manager
```

Provides the command `icon`.

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-08-09 |
| First published | 2022-07-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 6 |
| Unpacked size | 48.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | hayleycampbell, georgepayne, ylorph-eventstore |

## Links

- npm: https://www.npmjs.com/package/@eventstore-ui/icon-manager
- Repository: git@github.com:EventStore/Design-System
- npm.io page: https://npm.io/package/@eventstore-ui/icon-manager

## Dependencies (6)

- [svgo](https://npm.io/package/svgo.md) ^2.8.0
- [yargs](https://npm.io/package/yargs.md) ^15.3.1
- [semver](https://npm.io/package/semver.md) ^7.5.2
- [prettier](https://npm.io/package/prettier.md) ^3.0.0
- [clipboardy](https://npm.io/package/clipboardy.md) ^2.3.0
- [case-anything](https://npm.io/package/case-anything.md) ^2.1.13

## Recent versions

- 1.0.2 (latest) — 2024-08-09
- 0.1.0-alpha.10 (next) — 2022-08-31
- 1.0.1 — 2023-10-20
- 1.0.0 — 2023-07-26
- 0.1.8 — 2023-07-10
- 0.1.7 — 2023-06-29
- 0.1.6 — 2023-05-25
- 0.1.5 — 2023-04-20
- 0.1.4 — 2023-04-20
- 0.1.3 — 2023-02-20
- 0.1.2 — 2023-02-17
- 0.1.1 — 2023-02-16
- 0.1.0 — 2023-02-14
- 0.1.0-rc.1 — 2023-02-14
- 0.1.0-alpha.17 — 2022-12-28
- … 7 more at https://npm.io/package/@eventstore-ui/icon-manager/versions

## README

# @eventstore-ui/icon-manager

Automated icon inclusion for Event Store design system.

## Install

```shell
yarn add --dev @eventstore-ui/icon-manager
```

## Usage

**Global options**

| Option    | Description                   |
| --------- | ----------------------------- |
| --help    | Display help for this command |
| --version | Display the current version   |

### Add

```shell
icon add [name]
```

Adds an icon with the specified name to the specified directory, updating the index file

**Positionals**

| Option | Description                                              | Required | Type   |
| ------ | -------------------------------------------------------- | -------- | ------ |
| name   | The name of your icon (Will be converted to pascal case) | yes      | string |

**Options**

| Option      | Alias | Description                                                                            | Required | Type    |
| ----------- | ----- | -------------------------------------------------------------------------------------- | -------- | ------- |
| --dir       | -d    | Where to store your icons                                                              | yes      | path    |
| --file      | -f    | Take the SVG from a file path. Absolute, or relative to the current working directory. |          | path    |
| --clipboard | -c    | Take the SVG from the clipboard. Can have a file in your clipboard, or the svg data.   |          | boolean |
| --force     |       | Overwrite existing icons or aliases                                                    |          | boolean |

**Examples**

Add `MyIcon.tsx` to `./icons` from `./svg-icon.svg`

```shell
icon add MyIcon --dir=./icons --file=./svg-icon.svg
```

Add `MyIcon.tsx` to `./icons` from clipboard

```shell
icon add MyIcon --dir=./icons -c
```

Display help

```shell
icon add --help
```

### Remove

```shell
icon remove [name]
```

Removes the icon or alias with the specified name from specified directory, updating the index file

**Positionals**

| Option | Description                 | Required | Type   |
| ------ | --------------------------- | -------- | ------ |
| name   | The name the icon to remove | yes      | string |

**Options**

| Option | Alias | Description                 | Required | Type |
| ------ | ----- | --------------------------- | -------- | ---- |
| --dir  | -d    | Where your icons are stored | yes      | path |

**Examples**

Remove `MyIcon` from `./icons`

```shell
icon remove MyIcon --dir=./icons
```

Display help

```shell
icon remove --help
```

### Alias

```shell
icon alias [name] [alias]
```

Aliases the icon with the specified name from specified directory, updating the index file

**Positionals**

| Option | Description                | Required | Type   |
| ------ | -------------------------- | -------- | ------ |
| name   | The name the icon to alias | yes      | string |
| alias  | The name you want to alias | yes      | string |

**Options**

| Option | Alias | Description                 | Required | Type |
| ------ | ----- | --------------------------- | -------- | ---- |
| --dir  | -d    | Where your icons are stored | yes      | path |

**Examples**

Remove `MyIcon` from `./icons`

```shell
icon alias MyIcon YourIcon --dir=./icons
```

Display help

```shell
icon alias --help
```

### Namespace

```shell
icon namespace [namespace]
```

Sets or removes the namespace of the icons in the directory.
Prefix `namespace` with `@@` to use a symbol.
Omit `namespace` to remove the currently set namespace.

**Positionals**

| Option    | Description           | Required | Type   |
| --------- | --------------------- | -------- | ------ |
| namespace | The namespace to set. | no       | string |

**Options**

| Option | Alias | Description                 | Required | Type |
| ------ | ----- | --------------------------- | -------- | ---- |
| --dir  | -d    | Where your icons are stored | yes      | path |

**Examples**

Set namespace in `./icons` to the string "myNamespace".

```shell
icon namespace myNamespace --dir=./icons
```

Set namespace in `./icons` to a symbol exported as constant MY_NAMESPACE.

```shell
icon namespace @@myNamespace --dir=./icons
```

Remove namespace in `./icons`.

```shell
icon namespace --dir=./icons
```

Display help

```shell
icon namespace --help
```

### Upgrade

```shell
icon upgrade
```

Upgrades from an earlier version on `icon-manager` & `@eventstore-ui/components`

**Options**

| Option  | Alias | Description                                       | Required | Type    |
| ------- | ----- | ------------------------------------------------- | -------- | ------- |
| --dir   | -d    | Where your icons are stored                       | yes      | path    |
| --force |       | Forces an upgrade, even if version numbers match. |          | boolean |

**Examples**

Update icon set in `./icons`

```shell
icon upgrade --dir=./icons
```

Display help

```shell
icon upgrade --help
```

### Regenerate

```shell
icon regenerate
```

Regenerate your index from icons.json

**Options**

| Option | Alias | Description                 | Required | Type |
| ------ | ----- | --------------------------- | -------- | ---- |
| --dir  | -d    | Where your icons are stored | yes      | path |

**Examples**

Regenerate icon set in `./icons`

```shell
icon upgrade --dir=./icons
```

Display help

```shell
icon regenerate --help
```

### Display

Display icons in browser.

**Options**

| Option  | Alias | Description                 | Required | Type    | Default |
| ------- | ----- | --------------------------- | -------- | ------- | ------- |
| --dir   | -d    | Where your icons are stored | yes      | path    |         |
| --port  | -p    | Which port to host on       |          | number  | 8080    |
| --watch | -w    | Watch for changes           |          | boolean | true    |

**Examples**

Launch display server for icon set in `./icons`, on localhost:2022, watching for changes.

```shell
icon display --dir=./icons --port 2022
```

Don't watch for changes.

```shell
icon display --dir=./icons --watch false
```

Display help

```shell
icon display --help
```

## Pro tip

Add `icon` as a script in your package.json, set the directory for your project

**package.json**

```json
{
    "scripts": {
        "icon": "icon --dir=./src/icons"
    }
}
```

**usage**

```shell
yarn icon add MyIcon -c
```

---
_Source: https://npm.io/package/@eventstore-ui/icon-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
