https://github.com/ozum/replace-between
CLI utility for replacing text between markers with text from a file or stdin.
https://github.com/ozum/replace-between
Last synced: about 2 months ago
JSON representation
CLI utility for replacing text between markers with text from a file or stdin.
- Host: GitHub
- URL: https://github.com/ozum/replace-between
- Owner: ozum
- License: mit
- Created: 2017-03-15T06:33:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T21:10:41.000Z (over 5 years ago)
- Last Synced: 2025-03-21T09:22:56.967Z (2 months ago)
- Language: JavaScript
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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 `` and ``.
```
$ jsdoc2md index.js | replace-between --target README.md --token API
```A sample `README.md` for above command could be as below:
```md
# My ModuleLovely description.
# Details
Details of my module
# API
```
# 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. |# 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 | `/*` | `*/` |