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

vue-docservice

v0.1.82

Published

VueJS plugin for docservice.io

Downloads

16

Readme

Introduction

Add functionality from [docservice.io] to a VueJS project.

Quick Start

npm install vue-docservice --save

    or

yarn add vue-docservice

Add to a VueJS project

When used with a module system, you must explicitly install Vuex via Vue.use():

import Vue from 'vue'
import Contentservice from 'vue-contentservice'
import Docservice from 'vue-docservice'

Vue.use(Contentservice, options)

Add to a Nuxt project

Before beginning, you must have vue-contentservice already used in your project. Docservice is added to your Nuxt project in much the same way as Contentservice was added, by creating a Nuxt plugin.

~/plugins/vue-docservice.js:

import Vue from 'vue'
import Docservice from 'vue-docservice'

Vue.use(Contentservice, options)

nuxt.config.js:

module.exports = {
  ...
  plugins: [
    { src: '~plugins/vue-contentservice.js', ssr: false },
    ...
    { src: '~plugins/vue-docservice.js', ssr: false },
  ],
}

Note: this is plugins under module.exports, not to be confused with any of the Webpack plugins defined inside build.

Your Account Dashboard

Create a free ToolTwist account at http://tooltwist.com, and press 'Add Application' to get an APIKey for your application. This dashboard provides user administration, metrics, and other functionality.

Options

vue-docservice requires that an options object is passed to Vue.use().

These options relate to how your client application connects to the remote Contentservice.io server.

Some of these values may change during the different stages of your development, so the endpoint details are best saved in a configuration file, that can be overwritten during deployment. The convention we use is to place such a file in a directory named protected-config/websiteConfig.js:

/*
 *  This file gets overwritten during production deployments.
 */
module.exports = {
  docservice: {
    host: 'docservice.io',
    version: 'v2',
    apikey: 'API10O0X1XXXXXXXXXXXKN15ZXXX9'
  }
}

We then reference this file when setting our endpoints. Note that not all the values need to be defined.

// Load the configuration. This directory should be included in .gitignore.
import Config from '../protected-config/websiteConfig'

const options = {
  protocol: Config.docservice.protocol,
  host: Config.docservice.host,
  port: Config.docservice.port,
  version: Config.docservice.version,
  apikey: Config.docservice.apikey,
  ...
}

Using the Docservice components

When you edit a page, you will now see the Docservice widgets in the toolbox.