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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-helpers

v0.10.0

Published

Nuxt Helpers

Readme

Nuxt Helpers

npm XO code style

Collection of useful and SSR compatible vue plugins for using with nuxt.js

Features

  • Fully SSR compatible.
  • Tested and well designed for using with Nuxt.js.
  • Plugins can be used individually so bundle size remains small.
  • Easy nuxt installation

Getting started

1- Install nuxt-helpers package:

# YARN
yarn add nuxt-helpers

# NPM
npm install nuxt-helpers

2- Change your nuxt.config.js:

const NuxtHelpers = require('nuxt-helpers');

module.exports = NuxtHelpers([
    //'auth',
    //'axios',
    //'bootstrap',
    //'dev',
    //'meta',
    //'toast',
    //'optimize',
    //'font-awesome',
    //'moment',
    //'offline',
    // 'manifest',
    //'vendor',
], {

    // Your nuxt config

})

3- Add .nuxt-helpers to your .gitignore file

Available modules

Axios

This plugin is a wrapper around axios. It tries to resolve and make easier lot's of ajax tasks specially with SSR. So you can use $get('profile') instead of (await Axios.get('http://server/api/profile')).data.

  • Uses optionally custom URL when executing requests in server-side.
  • Handles all HTTP exceptions and prevents server side unhandled promise exceptions.
  • Injects $get,$post,... into vue context instances so requests can be done out-of-the-box.
  • Exposes setToken function so we can easily and globally set authentication tokens.
  • Returns empty object if request fails.
  • Throws nuxt-friendly exceptions if needed.

💡 Usage

  • Add axios to project package.json
  • Add axios helper
import {$get} from '~/nuxt-helpers/axios';

async data() {
    let {profile} = await $get('profile');
    return {profile}
}

Or In any other function: (This does not needs importing axios plugin)

mounted() {
    let {profile} = await this.$get('profile');
    return {profile}
}

Customization

Customization can be done using shared environment variables.

Environment variable | Default | Description ---------------------|-------------------------|-------------------------------------------- API_URL | http://localhost:3000 | Base url for ajax requests in server-side API_URL_BROWSER | [API_URL] | Base url for ajax requests in client-side API_PREFIX | /api | Adds this prefix before all relative urls

Bootstrap

With bootstrap-vue you can easily use standard bootstrap 4 components with your app. (you need to add bootstrap package in your package.json too)

💡 Usage

  • Add bootstrap-vue to package.json
  • Add bootstrap-vue helper
<template>
    <b-alert show>
        Hello Bootstrap!
    </b-alert>
</template>

Toast

Easy toasts for your app using mini-toastr.

💡 Usage

  • Add mini-toastr to package.json
  • Add toast helper

Then you can define notification in your routes or components:

export default {
   methods:{
     async login() {
         try {
             await this.$post('auth/login');
             this.$success('Welcome :)');
         } catch(e){
             this.$error('Error while authenticating');
         }
     }  
   }
}

Auth Store

💡 Usage

  • Add cookie & js-cookie to package.json
  • Add auth helper
// store/auth.js

import AuthStore from '~/.nuxt-helpers/auth';

const authStore = new AuthStore({ /*opts*/ });

// Your customizations

export default authStore;

Options

  • default_user : Default fields for state.auth.user. (overrides using Object.assign when logged-in).
  • token_cookie : Token cookie opts. (see js-cookie docs for more info)

Font Awesome

Leverage Font Awesome the iconic font and CSS toolkit.

💡 Usage

  • Add font-awesome to package.json
  • Add font-awesome helper

Optimize

This helper is not stable yet.

  • Normalizes names to app and vendor and sets assets public path to /assets.
  • Adds cssnano to postcss.
  • (TODO) Modernize SSR bundle with less transforms.

💡 Usage

  • Add cssnano to package.json
  • Add optimize helper

Offline

This helper is not stable yet.

This helper only works in non dev mode

  • Registers service worker
  • Scopes cacheName to allow having multi apps in same domain.

💡 Usage

  • Add offline helper

Manifest

This helper is not stable yet.

Adds Web App Manifest with no pain.

  • Creates static/manifest.json
  • Adds <link rel=manifest> to pages if not exits.
  • Adds <link rel=favicon> to pages if not exits.
  • Adds <meta name=description> to pages if not exits.
  • Adds <meta name=theme-color> to pages if not exits.
  • Adds title to pages if not exits.

💡 Usage

  • Add manifest helper
  • Add static/icon.png for your app icon.
  • Add additional options to nuxt.manifest to override defaults:
manifest:{
    name:'My Awesome App',
    dir:'rtl'
}

Vendor

This awesome little helpers creates junction symlinks from nodule_modules into static/vendor so you can directly serve node modules inside web. Useful for runtime dependencies.

💡 Usage

  • Add vendor helper
  • Add /static/vendor to .gitignore
  • Define your dependencies in nuxt.config.json inside vendor section:
{
    vendor: ['ckeditor']
}

Migration guide

If you are migrating from <= 0.7.0 version:

  • Plugins are now copied to project root to prevent babel problems.
  • Add .nuxt-helpers to .gitignore.
  • See new axios and auth usage description.
  • bootstrap plugin is renamed to bootstrap-vue.
  • notifications plugin is renamed to toast and usage simplified.

Contributions

Any contribution,bug report or component is highly welcomed :)

Contributors

License

MIT License - Fandogh 2017