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

@ppm-vi/needful-things

v2.1.0

Published

Needful things for Vue.js web projects

Downloads

20

Readme

Needful things for Vue.js web projects

Be aware that this package is tailored to our needs.

Installation

yarn add @ppm-vi/needful-things

Executable

There is also an executable ppmvi to run tasks like generating favicons. Execute the following command to use it:

yarn ppmvi --help

Currently there are two commands you can use

| Command | Arguments | Description | |-----------|--------|---------| | --generate-favicons | path to the folder | This command uses the realfavicongenerator api to generate favicons. | | --tinify | none | This command uses the TinyPNG api to compress images. Because it is a bad thing to compress your images multiple times, we add a meta tag to every image which lets us identify if it has already been optimized. |

Configuration

In order for something like generating favicons to work, you need to create a file .ppmvi.js inside your root directory. This file should export an object. This object can hold one of the following attributes.

| Attribute | Type | Default | Description | |-----------|--------|---------|-------------| | favicons | object | {} | The configuration for the realfavicongenerator api. https://realfavicongenerator.net/api/non_interactive_api | | tinify | object | {} | Configuration for the tinify cli command | | tinify > key | string | empty | The api key for TinyPNG |

Components

EmailLink

This component provides a simple way to include an a-tag with a mailto link.

Usage

EmailLink: () => import('@ppm-vi/needful-things').then(({ EmailLink }) => EmailLink)

Props

  • email String
    The actual email which should be used for the mailto link.

TelLink

This component provides a simple way to include an a-tag with a tel link. Whitespaces, / and - are automatically removed.

Usage

TelLink: () => import('@ppm-vi/needful-things').then(({ TelLink }) => TelLink)

Props

  • tel String
    The actual telephone number which should be used for the tel link.

  • wrapper Boolean Set to true if you dont want the component to render the telephone number into a span.

Slots

  • default The default slot inside the a tag

Meta Tags / Rel Links Helpers

All helpers return arrays or object, prepared for usage with vue-meta.

applyFacebookMetaTags

This method can be used to add the og meta tags.

Usage

import { applyFacebookMetaTags } from '@ppm-vi/needful-things';

//...

meta: [
    // meta tags before
    ...applyFacebookMetaTags()
    // meta tags after
]

Params

  • meta Object
    The object with the configuration which accepts the following attributes:
{
    type = '',
    title = '',
    description = '',
    image = '',
    siteName = ''
}

applyTwitterMetaTags

This method can be used to add the twitter meta tags.

Usage

import { applyTwitterMetaTags } from '@ppm-vi/needful-things';

//...

meta: [
    // meta tags before
    ...applyTwitterMetaTags()
    // meta tags after
]

Params

  • meta Object
    The object with the configuration which accepts the following attributes:
{
    title = '',
    description = '',
    image = '',
    site = '',
    creator = ''
}

applySplashscreenLinks

This method can be used to add meta tags for splashscreens.

Usage

import { applySplashscreenLinks } from '@ppm-vi/needful-things';

//...

link: [
    // links before
    ...applySplashscreenMetaTags()
    // links after
]

Params

  • url String default: /static/splashscreens
    The path where the splashscreens are located.

  • additional Array An array with objects for additional splashscreen links. The objects should have the following structure:

    {
        width: Number,
        height: Number,
        ratio: Number,
        orientation: String,
        href: String
    }

applyFaviconMetaTags

This method can be used to add all the meta tags necessary for favicons and pwa.

Usage

import { applyFaviconMetaTags } from '@ppm-vi/needful-things';

//...

meta: [
    // links before
    ...applyFaviconMetaTags()
    // links after
]

Params

  • options Object An objects with the configuration. The following options are available:
{
    url = '/static/icons',
    manifest: {
        url = '/static',
        name = 'manifest.json'
    },
    color = '#FFFFFF'
}

applyFaviconLinks

This method can be used to add all the links necessary for favicons and pwa.

Usage

import { applyFaviconLinks } from '@ppm-vi/needful-things';

//...

link: [
    // links before
    ...applyFaviconLinks()
    // links after
]

Params

  • options Object An objects with the configuration. The following options are available:
{
    url = '/static/icons',
    color = '#FFFFFF',
    statusBarStyle = 'default'
}