https://github.com/imcuttle/lerna-command-toc
lerna cli with custom command extensions
https://github.com/imcuttle/lerna-command-toc
Last synced: over 1 year ago
JSON representation
lerna cli with custom command extensions
- Host: GitHub
- URL: https://github.com/imcuttle/lerna-command-toc
- Owner: imcuttle
- License: mit
- Created: 2020-10-22T07:39:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-11T07:06:12.000Z (about 4 years ago)
- Last Synced: 2025-03-18T10:00:03.842Z (over 1 year ago)
- Language: JavaScript
- Size: 291 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
# lerna-command-toc
[](https://travis-ci.org/imcuttle/lerna-command-toc)
[](https://codecov.io/github/imcuttle/lerna-command-toc?branch=master)
[](https://www.npmjs.com/package/lerna-command-toc)
[](https://www.npmjs.com/package/lerna-command-toc)
[](https://prettier.io/)
[](https://conventionalcommits.org)
> lerna command for generate toc of packages in markdown
- Input (`README.md`)
```markdown
# my-package
## Packages
## Other
```
- Output (After run `lerna toc`)
```markdown
# my-package
## Packages
- [package-a](packages/a) - a description
- [package-b](packages/b) - b description
## Other
```
## Installation
```bash
npm install lerna-command-toc lerna-cli -D
# or use yarn
yarn add lerna-command-toc lerna-cli --dev
```
## Usage
- `lerna.json`
```json
{
"extendCommands": ["lerna-command-toc"],
"command": {
"toc": {}
}
}
```
- Run command
```bash
lerna toc --help
lerna toc
```
- We recommend use `lerna-command-toc` with `pre-comment` git hook
```json5
// package.json
{
husky: {
hooks: {
'pre-commit': 'npx lerna toc && git add README.md'
}
}
}
```
## Contributing
- Fork it!
- Create your new branch:
`git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
`git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)
## Authors
This library is written and maintained by imcuttle, imcuttle@163.com.
## License
MIT - [imcuttle](https://github.com/imcuttle) 🐟