# replace-between

> CLI utility for replacing text between markers with text from a file or stdin.

Latest version **0.0.8** (published 2017-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install replace-between
pnpm add replace-between
yarn add replace-between
bun add replace-between
```

Provides the command `replace-between`.

## 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.0.8 |
| Published | 2017-10-07 |
| First published | 2017-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Özüm Eldoğan |
| Maintainers | ozum |
| Keywords | utility, replace, cli |

## Links

- npm: https://www.npmjs.com/package/replace-between
- Repository: https://github.com/ozum/replace-between
- Homepage: https://github.com/ozum/replace-between#readme
- Issues: https://github.com/ozum/replace-between/issues
- npm.io page: https://npm.io/package/replace-between

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^2.x
- [yargs](https://npm.io/package/yargs.md) ^9.x
- [fs-extra](https://npm.io/package/fs-extra.md) ^4.x
- [get-stdin](https://npm.io/package/get-stdin.md) ^5.x
- [yargonaut](https://npm.io/package/yargonaut.md) ^1.x

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2017-10-07
- 0.0.7 — 2017-10-07
- 0.0.6 — 2017-07-25
- 0.0.5 — 2017-03-25
- 0.0.4 — 2017-03-24
- 0.0.3 — 2017-03-22
- 0.0.2 — 2017-03-21
- 0.0.1 — 2017-03-15

## README

# replace-between

CLI utility for replacing text between markers with text from a file or stdin.

# Usage

```
replace-between --source API.md --target README.md --token API
```

# Example

To put API in your `README.md`, you can put text generated by `jsdoc2md` between `<!--- API BEGIN --->` and `<!--- API END --->`.  

```
$ jsdoc2md index.js | replace-between --target README.md --token API
```

A sample `README.md` for above command could be as below: 

```md
# My Module

Lovely description.

# Details

Details of my module

# API

<!--- API BEGIN --->


<!--- API END --->
```


# Options

| Option  | Req |Description |
|:--------|:----|------------|
| token   |  ✓  | Token text to look for between start and end comment. BEGIN and END words are added automatically. |
| target  |  ✓  | Target file to replace text in. |
| source  |     | Source file to get replacement text from. If not provided STDIN is used instead. |
| comment |     | Predefined comment types to be used for replacement markers. (i.e. 'markdown' for `<!---` `--->`. If not provided, it is tried to be get from target file extension. |
| begin   |     | Beginning of the comment syntax. i.e `<!---` for markdown. |
| end     |     | End of the comment syntax. i.e `--->` for markdown. |

# Predefined Comment Strings

Predefined open and close tags are used for known file extensions if they are not overridden by `begin`, `end` or `comment` options. 

| Extension | Name        | Open    | Close  |
|-----------|-------------|---------|--------|
| md        | Markdown    | `<!---` | `--->` |
| js        | Javascript  | `/*`    | `*/`   |
| html      | HTML        | `<!--`  | `-->`  |
| css       | CSS         | `/*`    | `*/`   |

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