# readmelinks

> Helper tool to find all nested README.md files, generate links to them and insert those links to the root README.md

Latest version **0.2.1** (published 2021-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install readmelinks
pnpm add readmelinks
yarn add readmelinks
bun add readmelinks
```

Provides the command `readmelinks`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2021-01-19 |
| First published | 2020-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.15.0 |
| Dependencies | 0 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sergiy Seletskyy |
| Maintainers | sseletskyy |
| Keywords | tool, readme.md, link, generator |

## Links

- npm: https://www.npmjs.com/package/readmelinks
- Repository: https://github.com/sseletskyy/readmelinks
- Homepage: https://github.com/sseletskyy/readmelinks#readme
- Issues: https://github.com/sseletskyy/readmelinks/issues
- npm.io page: https://npm.io/package/readmelinks

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2021-01-19
- 0.2.0 — 2021-01-18
- 0.1.0 — 2020-08-06
- 0.0.2 — 2020-08-06
- 0.0.1 — 2020-08-06

## README

# readmelinks

<p>
  <a href='https://app.codeship.com/projects/404985'><img src='https://app.codeship.com/projects/adcb5e50-b9f4-0138-49d4-468ae6770853/status?branch=master' alt='Codeship Status for sseletskyy/readmelinks' /></a>
  <a href='https://coveralls.io/github/sseletskyy/readmelinks?branch=master'><img src='https://coveralls.io/repos/github/sseletskyy/readmelinks/badge.svg?branch=master' alt='Coverage Status' /></a>  
  <a href="https://www.npmjs.com/package/readmelinks">
    <img src="https://img.shields.io/npm/v/readmelinks.svg"
         alt="npm version">
  </a>
  <a href="https://packagephobia.now.sh/result?p=readmelinks">
    <img src="https://packagephobia.now.sh/badge?p=readmelinks"
         alt="install size">
  </a>
  <a href="https://github.com/sseletskyy/readmelinks/blob/master/LICENSE">
    <img src="https://img.shields.io/npm/l/readmelinks.svg"
         alt="license">
  </a>
  <a href="https://david-dm.org/sseletskyy/readmelinks">
    <img src="https://david-dm.org/sseletskyy/readmelinks/status.svg"
         alt="dependency status">
  </a>
</p>

## TL;DR

#### Install
```
npm i -D readmelinks
```
or
```
yarn add readmelinks -D
```
#### First run
```
yarn readmelinks
```

or

```
node_modules/.bin/readmelinks
```     

Check generated configuration in the `package.json`

## Overview
A simple tool which does two things
* finds all `*.md` files across the project (`<root>/src` is default folder for search)
* inserts links of found files into the `README.md` in the root of the project

## No extra dependencies
`readmelinks` uses only `Nodejs` API.

Although it is written in `typescript` and tested with Jest, in the end you are using a pure `Javascript` tool without any 3-rd party dependencies and thus unexpected surprises.

## Configuration
First run of `node_modules/.bin/readmelinks` inserts default configuration and script into `package.json`.

```
// package.json
{
  ...
  "scripts": {
    ...
    "readmelinks": "readmelinks"
  },
  ...    
  "readmelinks": {
    "srcRoot": "src",
    "commentMark": "readmelinks-generator",
    "regexp": "\\.md$"
  }
}
```
Then you can run the tool with a short command
```
npm run readmelinks
```
### Multiple configurations
You can define an array of configurations this way

```
// package.json
{
  ...
  "scripts": {
    ...
    "readmelinks": "readmelinks"
  },
  ...    
  "readmelinks": [
    {
      "srcRoot": "src",
      "commentMark": "readmelinks-generator",
      "regexp": "\\.md$"
    }, 
    {
      "srcRoot": "assets",
      "commentMark": "readmelinks-svg-generator",
      "regexp": "\\.svg$"
    }  
  ]
}
```

### Configuration params

#### `srcRoot`
Relative path to the search folder

##### Example:

Name of the project folder = `foo`

Name of the search folder = `app`

Absolute path to search folder = `~/project/foo/src/app`

Config value to use = `"srcRoot": "src/app"`

#### `commentMark`
Name of the comment placeholder, which `readmelinks` 
uses to find the location for generated content.

##### Example:
 
`"commentMark": "readmelinks-generator"`

First time `readmelinks` is executed it inserts two comment lines in the end of `README.md`
unless those comment lines are already present.
The generated list of links will be put between them. 

```
<!-- readmelinks-generator-begin -->
... generated content is updated here every time readmelinks is executed
<!-- readmelinks-generator-end -->

```  

You can move those two lines wherever you want in `README.md`

#### `regexp`

This attribute is required and expects a valid Regexp string,
so `new Regexp(regexp)` should not throw an error.

#### Examples:
`regexp: "\\.png$"`

#### `showFileName`

Optional parameter with boolean type.
If set to `true` then the link name will contain the name of the file

#### Examples
```
showFileName: false

* [components/Pagination/docs](docs/Pagination.md)
```

```
showFileName: true

* [components/Pagination/docs/Pagination.md](docs/Pagination.md)
```

---
_Source: https://npm.io/package/readmelinks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
