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

vue-block-documentation

v0.5.3

Published

Automatically generate API documentation for blocks.

Readme

Travis npm GitHub issues

A CLI generator to generate API documentation vue-block-system projects

Install

$ npm install -g vue-block-documentation

Commands

To use the generator open your console and change directory to the src directory of your vue-block-system project.

Demo

init-block-documentation

This will initialize the block documentation tool in your project, it will ask you to confirm some settings. This will most likely mean pressing enter until it's done.

$ init-block-documentation

generate-block-documentation

This is where the magic happens. Running this fill scan the block directory annd create a documentation folder in the src folder. Opening this on a webserver will display your generated documentation.

$ generate-block-documentation

Options:

  • -i, --input <input>: Override the input directory.
  • -o, --output <output>: Override the output directory.

Typing your block data

The tool will scan the block folders for the {BlockName}Data.js files, this file should contain all the data provided by your API. Describing the data is done by using Vue-Types.

Basic example

import VueTypes from 'vue-types';

export default {
	heading: VueTypes.string.isRequired,
	paragraph: VueTypes.string.isRequired,
	image: VueTypes.shape({
		src: VueTypes.string.isRequired,
		alt: VueTypes.string.isRequired,
	}).isRequired,
};

Using external objects

To avoid having to redefine the same object over and over again you can also import js files that describe the shape of the reusable object

ImageDataObject.js

import VueTypes from 'vue-types';

export default {
	src: VueTypes.string.isRequired,
	alt: VueTypes.string.isRequired,
};

BlockFooData.js

import VueTypes from 'vue-types';
import ImageDataObject from './image-data-object';

export default {
	heading: VueTypes.string.isRequired,
	paragraph: VueTypes.string.isRequired,
	image: VueTypes.shape(ImageDataObject).isRequired,
};

Adding custom descriptions and placeholders

When generating API documentation it also outputs example json structures, for easy development you want this to be as accurate as possible for the backender building your API. To create better documentation you can add descriptions and placeholder values into your object describing the object. You do this by adding a comment block above your data object. The structure for adding descriptions and placeholder is as followed:

@param {description|placehoder} [NAME_OF_YOUR_PARAM] Your description goes here...

This could end up in the following:

import VueTypes from 'vue-types';

/**
 * @param {description} heading This is the heading of the component
 * @param {placeholder} heading Lorem ipsum dolor sit amet
 *
 * @param {description} paragraph This is the paragraph of the component
 * @param {placeholder} paragraph Lorem ipsum dolor sit amet
 *
 * @param {description} image this is the image object of the component
 *
 * @param {description} image.src this is the source of your image
 * @param {placeholder} image.src path/to/image.jpg
 *
 * @param {description} image.alt this is the alt text for your image 
 * @param {placeholder} image.alt path/to/image.jpg 
 */
export default {
	heading: VueTypes.string.isRequired,
	paragraph: VueTypes.string.isRequired,
	image: VueTypes.shape({
		src: VueTypes.string.isRequired,
		alt: VueTypes.string.isRequired,
	}).isRequired,
};

Notes:

  1. All imported files should be javascript files and will be parsed as es2015.
  2. When using external object, descriptions and placeholders are shared amongst all parent files!

Demo

This tool wil only work on a vue-block-system project. I've created an example output so you can preview what the output might look like!

Check the example output online.