Git Product home page Git Product logo

cli's Introduction

logo

DokuIn.js

npm version install size npm downloads

Lets you make documentation for your REST API easier. New to DokuIn.js ? Take a look at the Tutorial and Guide

Table of Contents

Installation

Make sure you have Node.js and NPM installed. Then you can install DokuIn.js in your machine globally with command

$ npm install -g dokuinjs

Usage

Run DokuIn.js in your terminal with command

$ dokuin init

Provide your project details

Project Name :
Project Description :
Project Base URL :
Author :

Run this command to show DokuIn.js menu list

$ dokuin start

Please choose 1 command :

[x]  Create new configuration
[ ]  Create new endpoint list
[ ]  Run endpoint list
[ ]  Generate Markdown
[ ]  Show endpoint list
[ ]  Add new endpoint into endpoint list
[ ]  Update an endpoint on the list 
[ ]  Delete endpoint in existing endpoint list

Choose second option to create new endpoints

You can put your endpoints as many as you want.

[x]  Create new endpoint list

This option will show endpoint list

[x]  Show endpoint list

Choose this one to get all responses from endpoint list

[x]  Run endpoint list

And finally convert responses to Markdown file with this option

[x]  Generate Markdown

Voila your documentation is ready!

Example

Install and make config file with DokuIn.js

$ npm i -g  dokuinjs

$ dokuin init

Project Name : netflux
Project Description : it is practice project restful api
Project Base URL : http://localhost:3000
Author : meggy

Create endpoint list

1. Example

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
[x]  Create new endpoint list
[ ]  Run endpoint list
[ ]  Generate Markdown
[ ]  Show endpoint list
[ ]  Add new endpoint into endpoint list
[ ]  Update an endpoint on the list 
[ ]  Delete endpoint in existing endpoint list

HTTP Method : get
Path: /products
Endpoint description : get all products

Add Headers ? (yes / no) yes
Key: token
Value: dok23uin42js52ist52di32e78be67ste
Add more headers ? (yes / no) no

Add Query Params ? (yes / no) yes
Key: id
Value: w8974e89is0oo
Add more query params ? (yes / no) no 

Add Request Body ? (yes / no) no
Add more endpoints ? (yes / no) no

2. Example

$ dokuin start

Please choose 1 command :

[ ]  Create new configuration
[x]  Create new endpoint list
[ ]  Run endpoint list
[ ]  Generate Markdown
[ ]  Show endpoint list
[ ]  Add new endpoint into endpoint list
[ ]  Update an endpoint on the list 
[ ]  Delete endpoint in existing endpoint list

HTTP method: put
Path: /movies
Endpoint description: update one movie

Add Headers ? (yes / no): yes
Key: token
Value: dok23uin42js52ist52di32e78be67ste
Add more headers ? (yes / no) no

Add Query Params ? (yes / no) yes
Key: movieId
Value: w8974e89is0oo
Add more query params ? (yes / no) no

Add Request Body ? (yes / no) yes
Key: title
Value: dark
Key: genre
Value: adventure
Add more request body ? (yes / no) yes
Key: popularity
Value: 34.912
Add more request body ? (yes / no) no

Add more endpoints ? (yes / no) : no

Show endpoint list

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
..
[x]  Show endpoint list
.. 
..
..

----------------------------------------------------------------------------
|(index)| id  |  Method  |          Path               |    Description    |
|   1   |  1  |   GET    | http://localhost:3000       | Get all movies    |
|   2   |  2  |   POST   | http://localhost:3000/login | login             |
----------------------------------------------------------------------------

Delete an endpoint

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
..
..
..
..
..
[x]  Delete endpoint in existing endpoint list

----------------------------------------------------------------------------
|(index)| id  |  Method  |          Path               |    Description    |
|   1   |  1  |   GET    | http://localhost:3000       | Get all movies    |
|   2   |  2  |   POST   | http://localhost:3000/login | login             |
----------------------------------------------------------------------------
Endpoint ID : 1 

Add new endpoints to the list

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
..
..
[x]  Add new endpoints into endpoint list
.. 
..

HTTP Method : post
Path: movies/

Add Headers ? (yes / no) no
Add Query Params ? (yes / no) no
Add Request Body ? (yes / no) yes

Key: email
Value: [email protected]
Add more Request Body ? (yes / no) yes
Key: password
Value: 12opw9d9s
Add more request body ? (yes / no) no

Add more endpoints ? (yes / no) no

Update an endpoint on the list

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
..
..
..
..
[x]  Update an endpoint on the list 
..

Which endpoint 
[x] GET, http://localhost:3000
[ ] POST, http://localhost:3000/login

[ ] method
[ ] description
[ ] path
[ ] query 
[x] body

Current Value
key: username, value: caeasaradam
value: <updated value> 
More update ? (yes / no) yes 

[x] GET, http://localhost:3000
[ ] POST, http://localhost:3000/login

Which key 
[x] method
[ ] description
[ ] path
[ ] query 
[ ] body

Current Value: GET
HTTP Method:  <updated method> 
More Update ? (yes / no) no

Run endpoint list

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
[x]  Run endpoints
..
..
..
.. 
..

Convert responses

$ dokuin start  

Please choose 1 command :

[ ]  Create new configuration
..
..
[x]  Generate Markdown
..
..
.. 
..

cli's People

Contributors

aronanur avatar dependabot[bot] avatar muhafaa avatar purandrar avatar rafiandria23 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

cli's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm build-url Unavailable

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/dokuinjs.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @types/json2md ^1.5.1
  • axios ^1.6.0
  • boxen ^7.0.0
  • build-url ^6.0.1
  • chalk ^5.0.1
  • charm ^1.0.2
  • clear ^0.1.0
  • colors ^1.4.0
  • enquirer ^2.3.4
  • esm ^3.2.25
  • figlet ^1.5.2
  • inquirer ^9.0.2
  • json2md ^2.0.0
  • ora ^8.0.0
  • typescript ^5.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.