## FontAwesome.js - ES6, CommonJS, and AMD module
> "I came here to chew bubblegum and install Font Awesome 5 - and I'm all out of bubblegum"
### npm linking
While we are in are Beta period we won't be publishing packages to npmjs.com.
Instead we are going to recommend [linking](https://docs.npmjs.com/cli/link).
The basic steps of this:
1. Clone the [Font-Awesome-Pro](https://github.com/FortAwesome/Font-Awesome-Pro) repository
1. Tell npm (or yarn) where the packages are
1. Link to the packages in your project
#### Example
Let's say that we've cloned the repository to `~/Development/projects/FortAwesome/Font-Awesome-Pro`.
And let's say that we have a project we'd like to use Font Awesome 5 Pro on in `~/Development/projects/myorg/myapp`.
##### Tell npm (or yarn) where the packages are
```
$ cd ~/Development/projects/FortAwesome/Font-Awesome-Pro/packages/fontawesome
$ npm link
$ cd ~/Development/projects/FortAwesome/Font-Awesome-Pro/packages/fontawesome-solid
$ npm link
```
If you want the Regular, Light, or Brands styles change directories to those packages and do the same `npm link`.
##### Link to the packages in your project
```
$ cd ~/Development/projects/myorg/myapp
$ npm link @fortawesome/fontawesome
$ npm link @fortawesome/fontawesome-solid
```
### Copying the packages to your project
Using `npm link` is convenient when the project you are linking to changes
often and you want to easily keep up. It however is not convenient if you are
on a team and sharing a repository with someone else or you have a continuous
integration or continuous delivery service. In these cases the build will fail
when any dependency on `@fortawesome/fontawesome` packages are imported in your
app since the linking is not part of the normal `npm install` or `yarn install`
process.
An alternative to linking is to include the packages in your own project.
#### Example
Let's assume all your app's JavaScript is in `src/js`.
```
$ cd ~/Development/projects/myorg/myapp
$ cp ~/Development/projects/FortAwesome/Font-Awesome-Pro/packages/fontawesome/index.js ./src/js/fontawesome.js
$ cp ~/Development/projects/FortAwesome/Font-Awesome-Pro/packages/fontawesome-solid/index.js ./src/js/fontawesome-solid.js
```
This is kinda gross but until we get packaging setup for our Pro users this will get you by.
## Let's get started
Once you have the packages installed (make sure you get `fontawesome` and at
least one of the styles) you can require or import the library. We're going to give examples in ES6 syntax using import.
```javascript
import fontawesome from '@fortawesome/fontawesome'
import { faUser } from '@fortawesome/fontawesome'
fontawesome.icon(faUser)
```
See the [API reference](#api-reference) for more information on what API is available.
## Icon naming
From the beginning Font Awesome has used hyphenated names like `fa-address-book`, `fa-facebook`, or `fa-circle-o`.
JavaScript does not typically use this kind of naming scheme; it uses camelCase. So here are some basic examples of
how imports will work.
* `fa-address-book` becomes `import { faAddressBook } from '@fortawesome/fontawesome-solid'`
* `fa-facebook` becomes `import { faFacebookF } from '@fortawesome/fontawesome-brands'` (it's in the Brands style and this was renamed to facebook-f)
* `fa-circle-o` becomes `import { faCircle } from '@fortawesome/fontawesome-regular'` (the outlines are in the Regular style)
* `fa-area-chart` becomes `import { faChartArea } from '@fortawesome/fontawesome-regular'` (this was renamed)
* `fa-freebsd` becomes `import { faFreebsd } from '@fortawesome/fontawesome-brands'` (OCD-warning: we know it's FreeBSD but consistency/guessability is the goal here)
## Configuration
Font Awesome 5 has several configuration options that affect how the library operates.
*Make sure you set your config as early as possible when using automatic CSS inserting* (more on this later)
In a browser the config is exported to `window.FontAwesomeConfig`.
Access the configuration in your app with:
```javascript
import fontawesome from '@fortawesome/fontawesome'
fontawesome.config
```
To update the configuration:
```javascript
import fontawesome from '@fortawesome/fontawesome'
fontawesome.config = {
familyPrefix: 'fa'
}
```
There is no need to send every possible config value when updating the config. Properties will
be merged with the existing properties and values.
### Options
**familyPrefix** default `fa`
* `String` used to prefix classes like `fa-spin`. Changing this would allow you
to still use Font Awesome 4 with the prefix of `fa`.
**replacementClass** default `svg-inline--fa`
* `String` used as the base class name when building the SVG elements. If you
changed this to `foo` the SVGs would start with `