Socket
Socket
Sign inDemoInstall

vue-docgen-api

Package Overview
Dependencies
Maintainers
3
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-docgen-api

Toolbox to extract information from Vue component files for documentation generation purposes.


Version published
Weekly downloads
467K
increased by9.79%
Maintainers
3
Weekly downloads
 
Created

What is vue-docgen-api?

The vue-docgen-api package is a tool for extracting documentation from Vue.js components. It parses Vue single-file components (SFCs) and generates JSON output that can be used to create documentation websites, IDE plugins, or other tools that need to understand the structure and properties of Vue components.

What are vue-docgen-api's main functionalities?

Extracting Props

This feature allows you to extract the props of a Vue component. The code sample demonstrates how to parse a Vue component file and log its props to the console.

const docgen = require('vue-docgen-api');
docgen.parse('./path/to/YourComponent.vue').then((componentDoc) => {
  console.log(componentDoc.props);
});

Extracting Slots

This feature allows you to extract the slots of a Vue component. The code sample demonstrates how to parse a Vue component file and log its slots to the console.

const docgen = require('vue-docgen-api');
docgen.parse('./path/to/YourComponent.vue').then((componentDoc) => {
  console.log(componentDoc.slots);
});

Extracting Events

This feature allows you to extract the events emitted by a Vue component. The code sample demonstrates how to parse a Vue component file and log its events to the console.

const docgen = require('vue-docgen-api');
docgen.parse('./path/to/YourComponent.vue').then((componentDoc) => {
  console.log(componentDoc.events);
});

Extracting Methods

This feature allows you to extract the methods of a Vue component. The code sample demonstrates how to parse a Vue component file and log its methods to the console.

const docgen = require('vue-docgen-api');
docgen.parse('./path/to/YourComponent.vue').then((componentDoc) => {
  console.log(componentDoc.methods);
});

Other packages similar to vue-docgen-api

Keywords

FAQs

Package last updated on 29 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc