https://github.com/nfroidure/jsarch
A simple module to extract architecture notes from your code.
https://github.com/nfroidure/jsarch
documentation hacktoberfest javascript
Last synced: 10 months ago
JSON representation
A simple module to extract architecture notes from your code.
- Host: GitHub
- URL: https://github.com/nfroidure/jsarch
- Owner: nfroidure
- License: mit
- Created: 2017-02-27T07:32:18.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T10:46:01.000Z (over 1 year ago)
- Last Synced: 2024-12-04T11:34:30.478Z (over 1 year ago)
- Topics: documentation, hacktoberfest, javascript
- Language: TypeScript
- Homepage:
- Size: 2.73 MB
- Stars: 25
- Watchers: 5
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# jsarch
> A simple module to extract architecture notes from your code.
[](https://github.com/nfroidure/jsarch/blob/main/LICENSE)
[//]: # (::contents:start)
## Usage
To generate any project's architecture notes:
```
jsarch src/*.js > ARCHITECTURE.md
```
### Configuration
You can set your own configuration by adding a `jsarch` property in your
`package.json` file (see
[the defaults](https://github.com/nfroidure/jsarch/blob/master/src/jsarch.js#L20-L36)).
For example, if you which to have TypeScript support and you use Gitlab instead
of GitHub, just add this:
```js
{
// (...)
"jsarch": {
"gitProvider": "bitbucket",
"parserOptions": {
"plugins": ["typescript"]
}
}
// (...)
}
```
Per default, the Babel parser is used, but you can change it with the `parser`
option. You'll have to install it before using it.
## Development
To get involved into this module's development:
```sh
npm i -g jsarch
git clone git@github.com:nfroidure/jsarch.git
cd jsarch
npm it
npm run build
node bin/jsarch **/*.js > ARCHITECTURE.md
```
## Architecture Notes
You can see [this repository architecture notes](./ARCHITECTURE.md) for an
example of the kind of content generated by this module.
[//]: # (::contents:end)
## initJSArch(services) ⇒ Promise.<function()>
Declare jsArch in the dependency injection system
**Kind**: global function
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | Object | | Services (provided by the dependency injector) |
| services.CONFIG | Object | | The JSArch config |
| services.EOL | Object | | The OS EOL chars |
| services.glob | Object | | Globbing service |
| services.fs | Object | | File system service |
| services.parser | Object | | Parser service |
| [services.log] | Object | noop | Logging service |
### initJSArch~jsArch(options) ⇒ Promise.<String>
Compile an run a template
**Kind**: inner method of [initJSArch](#initJSArch)
**Returns**: Promise.<String> - Computed architecture notes as a markdown file
| Param | Type | Description |
| --- | --- | --- |
| options | Object | Options (destructured) |
| options.cwd | Object | Current working directory |
| options.patterns | Object | Patterns to look files for (see node-glob) |
| options.eol | Object | End of line character (default to the OS one) |
| options.titleLevel | Object | The base title level of the output makdown document |
| options.base | Object | The base directory for the ARCHITECTURE.md references |
# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)
# License
[MIT](https://github.com/nfroidure/jsarch/blob/main/LICENSE)