npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nuxt-fontawesome

v0.4.0

Published

Module to join nuxt and Fontawesome 5

Downloads

19,064

Readme

Nuxt Font Awesome 5

npm (scoped with tag) npm

Plugin to join nuxt and Font Awesome 5 icons using official vue-fontawesome plugin. Supports ES6 imports with tree shaking and fix of initial load flickering

Setup

  • Add dependencies using npm to your project npm i nuxt-fontawesome Also it may be needed to explicitly install fontawesome, if your webpack build fails npm i @fortawesome/fontawesome-svg-core @fortawesome/vue-fontawesome
  • Configure nuxt.config.js:
    • Add nuxt-fontawesome to modules section
    • Configure loaded icons/whole sets
  • See more details about usage below
{
  modules: [
    'nuxt-fontawesome',
    //OR like this
    ['nuxt-fontawesome', {
      component: 'fa', 
      imports: [
        //import whole set
        {
          set: '@fortawesome/free-solid-svg-icons',
          icons: ['fas']
        },
        //import 2 icons from set 
        // please note this is PRO set in this example, 
        // you must have it in your node_modules to actually import
        {
          set: '@fortawesome/pro-regular-svg-icons',
          icons: ['faAdjust', 'faArchive']
        }
      ]
    }]
  ],
  //alternative place for config
  fontawesome: {
    imports: [
      ...
    ]
  }
}

Module options

component

Change component name. For example, fa to use like <fa ... />

  • Default: font-awesome-icon

imports

Import icons/whole sets from chosen packages

  • Default: [], no icons will be imported here (see below, can be loaded later inside .vue file)
    • set - path to node package for import, like @fortawesome/free-solid-svg-icons
    • icons - array of icons to import ['faAdjust', 'faArchive'].

Usage

You can find more details under example folder. Also please see vue-fontawesome for additional reference

  • Add needed dependency, like npm i @fortawesome/free-solid-svg-icons
  • Add configuration like this in nuxt.config.js

Component names by default:

  • <font-awesome-icon>
  • <font-awesome-layers>
  • <font-awesome-layers-text>

With component option set, -layers and -layers-text suffixes will be appended (see example below)

{
  fontawesome: {
    imports: [
        {
          set: '@fortawesome/pro-regular-svg-icons',
          icons: ['faAdjust']
        },
        {
          set: '@fortawesome/free-solid-svg-icons',
          icons: ['fas']
        },
    ],
  },
}

Then use

<template>
    <div>
      <font-awesome-icon :icon="['fas', 'adjust']"  />
      <font-awesome-icon icon="dollar-sign"  style="font-size: 30px"/>
      <font-awesome-icon icon="cog"/>
      <font-awesome-layers class="fa-4x">
        <font-awesome-icon icon="circle"/>
        <font-awesome-icon icon="check" transform="shrink-6" :style="{ color: 'white' }"/>
      </font-awesome-layers>
      <font-awesome-layers full-width class="fa-4x">
        <font-awesome-icon icon="calendar"/>
        <font-awesome-layers-text transform="shrink-8 down-3" value="27" class="fa-inverse" />
      </font-awesome-layers>
    </div>
</template>
  • Load and use directly in template. Component name changed in nuxt.config.js to fa
fontawesome: {
  component: 'fa'
},
<template>
    <div>
        <fa-layers full-width class="fa-4x">
          <fa :icon="fas.faCircle"/>
          <fa-layers-text transform="shrink-12" value="GALSD" class="fa-inverse" />
        </fa-layers>
        <fa :icon="fas.faAddressBook"  />
        <fa :icon="faGithub" />
    </div>
</template>
<script>
  import { fas } from '@fortawesome/free-solid-svg-icons'
  import { faGithub } from '@fortawesome/free-brands-svg-icons'
  export default {
    computed: {
      fas () {
         return fas
      },
      faGithub () {
         return faGithub
      }
    },
  }
</script>

License

MIT, made by Galley Web Development