Socket
Book a DemoInstallSign in
Socket

@blitzm/doccy

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blitzm/doccy

## Overview

latest
npmnpm
Version
0.1.7
Version published
Weekly downloads
3
-70%
Maintainers
3
Weekly downloads
 
Created
Source

doccy

Overview

Doccy is a documentation tool for GRPC APIs.

Doccy includes a CLI program that can be used to generate a static JSON file that represents your GRPC Proto Spec.

Doccy also includes a React component that can use the generated JSON file to render documentation inside your website.

See the "./example" directory to see a minimal React application that shows the Doccy's <DoccyPage protojson={require('../doccyprotos.json')} /> component.

Creating a doccyprotos.json file

npm install @blitzm/doccy

# see usage
./node_modules/.bin/doccy --help

# generate a doccyprotos.json file from
# a directory containing .proto files
./node_modules/.bin/doccy -o doccyprotos.json ./path/to/protos/**/*.proto

Using the React Component

import { DoccyPage } from '@blitzm/doccy';

export function Documentation() {
  return (
    <DoccyPage protojson={require('./doccyprotos.json')} />
  );
}

System Requirements

  • NodeJS 15
  • Golang 1.16
  • protoc-gen-json (available here)

Development

To develop doccy you can use the "./example" project.

There's an included script called ./doccy.sh that runs the doccy CLI from source using ts-node.

You can use this script to run the doccy CLI from source to generate test doccyprotos.json files.

The example project is a small React app that imports DoccyPage from the lib directory.

To develop the <DoccyPage /> component you can run the example app:

cd ./example
./doccy.sh -o doccyprotos.json ../../path/to/some/protos/**/*.proto
npm install
npm start

Running the Docker Image Locally

# build the image
docker build -t website .

# run the container (localhost:3000)
docker run --rm -it -p 3000:80 website`

FAQs

Package last updated on 03 Jun 2021

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