1.0.9 • Published 1 year ago

gptdoc v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Preview

Functions labeled with /** @gpt */ get an autogenerated doc comment

/** @gpt */
function Greet(name) {
    console.log(`Hello ${name}`);
}
/**
 * @autogenerated
 * @summary Generates a greeting to the passed in name
 * @param {string} name - The name to greet
 */
function Greet(name) {
    console.log(`Hello ${name}`);
}

Install in project

Install gptdoc as a dev dependency

npm i --save-dev gptdoc 

Execute

node node_modules/gptdoc [args]

Config

You can specify a configuration file:

node node_modules/gptdoc -c .myconfig

If none provided, the script will look for .gptdoc

Sample Config file

{
    "DEBUG": false,
    "framework": "JSDOC",
    "language": "JS",
    "files": {
        "src": "./src",
        "dest": "./gpt"
    },
    "openai": {
        "temperature": 0.7,
        "top_p": 1,
        "max_tokens": 256,
        "model": "text-davinci-003"
    }
}

Find more info about the config here

API Key

Add a .env file in your root directory with OPENAI_API_KEY

or set the OPENAI_API_KEY as a system environement variable.

find your API key here

Document this project

Running docself in the cloned repo will document source files in ./src/

npm run docself

Running test in the cloned repo will document ./example/example.js

npm run test

Contributing

Constructive criticism, Issues and PRs are more than welcome!


License MIT

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7-b

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago