nestdoc
Nest.JS documentation generator
Installation
sudo npm install -g nestdoc
CLI
# Input dir
nestdoc src
# Output dir
--output -o documentation
# Watch mode
--watch -w
# Base url
--base -b '/docs'
# Custom logo
--logo -l 'http://example.com/images/logo.png'
# Custom favicon
--favicon -f 'http://example.com/images/favicon.png'
# Start server
--serve -s
# Server host
--host -h 'localhost'
# Server port
--port -p 3000
Documentation comments
/**
* Service description
*/
@Injectable()
export class MyService {
constructor(
/**
* Property description
*/
private readonly otherService: OtherService,
) {}
/**
* Method description
* @args
* - arg1: Arg 1 description
* - arg2: Arg 2 description
* @returns Return value description
* @example
* const result = await this.myService.myMethod(arg1, arg2);
* @author Author Name <author@email.com>
* @deprecated
* @throws HttpException('Not found!', 404)
* @throws HttpException('Forbidden', 402)
* @todo
* - Issue 1
* - Issue 2
*/
async myMethod(
arg1: number,
arg2: string,
): Promise<MyResult> {
// Method body
}
}