https://github.com/commenthol/flinc
recursively include files
https://github.com/commenthol/flinc
Last synced: 8 months ago
JSON representation
recursively include files
- Host: GitHub
- URL: https://github.com/commenthol/flinc
- Owner: commenthol
- License: mit
- Created: 2019-05-23T17:45:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-23T17:47:27.000Z (about 7 years ago)
- Last Synced: 2025-02-15T21:01:43.601Z (over 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flinc
> recursively include files
[](https://www.npmjs.com/package/flinc/)
a.txt
```
aaa
!include(./b.txt)
ccc
```
b.txt
```
bbb
```
run `flinc a.txt`
```
aaa
bbb
ccc
```
# cli
```
NAME
flinc - recursively include files
SYNOPSIS
flinc [options]
OPTIONS
-h, --help
Display this help and exit.
--version
Output version information and exit.
-o, --output outfile
Specify the filename for the processed output. Defaults to stdout.
-r, --regex
regular expression to search for include tags. Defaults to !include(filename)
EXAMPLE
Process a README.md file:
flinc -o README.md README.md
Use a cusom regular expression for tag myinclude filename.txt and output to stdout:
flinc --regex "^myinclude\s+(.*?)\s*$" mytext.txt
INSTALLATION
npm i -g flinc
```
# api
> NOTE: Reading files is done synchronously - aka blocking.
```js
const FileInclude = require('flinc')
const { text } = new FileInclude().read(`${__dirname}/a.txt`).build()
```
# license
MIT licensed