https://github.com/andrewmaksimchuk/documentation-module
Documentation module pattern and tool for watch tham.
https://github.com/andrewmaksimchuk/documentation-module
documentation nodejs
Last synced: about 1 month ago
JSON representation
Documentation module pattern and tool for watch tham.
- Host: GitHub
- URL: https://github.com/andrewmaksimchuk/documentation-module
- Owner: AndrewMaksimchuk
- License: mit
- Created: 2022-09-28T17:01:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-28T18:29:29.000Z (over 3 years ago)
- Last Synced: 2025-10-11T01:40:04.572Z (9 months ago)
- Topics: documentation, nodejs
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Example of documentation the module and get quick that information.
### Module:
```
import { openSync, writeFileSync } from "fs";
export function log(tty, value) {
return writeFileSync(openSync(tty, "w+"), JSON.stringify(value) + "\n");
}
export const __doc__ =
`
Parameters:
1. tty - The file name of the terminal connected to standart input (linux tty command).
2. value - Any data type that can be converted to a string type.
Return:
Function call "writeFileSync" from "fs" module.
`;
log.__doc__ = __doc__;
```
`__doc__ ` - Is like protected property that store text description of module. All what developer whant to write.
`log.__doc__ = __doc__;` - It`s option, for your needs, available in runtime.
For quick see the documentation, just write command `doc path_to_module` and the text will be displayed.
### Example:
Write in terminal `doc ./example_module.js`
Then see:
```
Documentation for the module:
example_module.js
Parameters:
1. tty - The file name of the terminal connected to standart input (linux tty command).
2. value - Any data type that can be converted to a string type.
Return:
Function call "writeFileSync" from "fs" module.
```
### Examples of launches:
`doc ./module.js`
`./doc.js ./example_module.js`
`npm run doc ./example_module.js`
`node ./doc.js ./example_module.js`
### Install:
`npm run install`
Installing - it`s just create symlink "doc" to package file doc.js.
### NPM scripts:
`doc` - See the documentation of module.
`install` - Install package.
`remove` - Remove package.
`check` - Check if package installed.