Create mac folder
![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)
A cli tool to create macOS style folders from SVG files.
Creates .png
and .icns
files from SVGs.
Tested with various icon types via svg-icon.
create-mac-folder
will attempt to make all SVGs compatible though there are limitations of what can be done.
Most SVGs will work just fine (See examples below).
Installation
npm install --global macos-folder-icons
Usage
Option | Alias | Type | Default | Description |
---|
<input> | n.a. | string | n.a. | Default command |
--out-dir | -o | string | ./macos-folder-icons | Defines the output directory |
--ignore | -i | string | undefined | Defines ignore patterns |
--port | -p | number | 1337 | Change the port if 1337 is taken |
--size | -s | number | 424 | Change the size of the icon viewBox |
Core options
Option | Description |
---|
--help | prints help |
--version | prints version |
Single files
create-mac-folder path/to/my.svg
Multiple files
create-mac-folder one.svg two.svg
create-mac-folder '{one,two,four}.svg'
create-mac-folder 'path/to/my/*.svg'
Options
Input
Input is required. It allows using multiple strings or glob patterns,
path/to/my.svg
--> ./macos-folder-icons/my.svg
create-mac-folder path/to/my.svg
Glob patterns
Make sure to put your glob patterns in quotes '**/glob/*/pattern'
.
create-mac-folder 'path/to/my/*.svg'
Out Dir
Defines the output directory relative to the current working directory (process.cwd()
).
path/to/my.svg
--> ./out/my.svg
create-mac-folder path/to/my.svg -o out
Ignore
Defines files to ignore. Allows glob patterns and multiple definitions
Make sure to put your glob patterns in quotes '**/glob/*/pattern'
.
**/*.svg, !**/qux/*.svg, !foo/bar/baz.svg
--> ./macos-folder-icons/*
create-mac-folder '**/*.svg' --ignore '**/qux/*.svg' --ignore 'foo/bar/baz.svg'
Port
Change the port in case 1337
is already in use
create-mac-folder path/to/my.svg --port 3000
Size
Define the size of the icon. The default is optimized to use circular icons from
svg-icon/simple
(e.g.
)
create-mac-folder path/to/my.svg --size 300
Examples
Take a look at the Example files.
Input / Output