# generic-text-linker

> Generic text linker for NodeJs

Latest version **1.7.31** (published 2022-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install generic-text-linker
pnpm add generic-text-linker
yarn add generic-text-linker
bun add generic-text-linker
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.7.31 |
| Published | 2022-10-20 |
| First published | 2018-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6.4 |
| Dependencies | 6 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Imre Toth |
| Maintainers | vidaxl.com, vidaxl-devops, 311ecode |
| Keywords | linker, linking, text linker, tool, tooling, development, cowlog |

## Links

- npm: https://www.npmjs.com/package/generic-text-linker
- Repository: https://github.com/dsl-toolkit/dsl-toolkit
- Homepage: https://github.com/dsl-toolkit/dsl-toolkit/tree/master/packages/generic-text-linker
- Issues: https://github.com/dsl-toolkit/refresh-me/issues
- npm.io page: https://npm.io/package/generic-text-linker

## Dependencies (6)

- [clone](https://npm.io/package/clone.md) ^2.1.2
- [bottlejs](https://npm.io/package/bottlejs.md) ^2.0.0
- [is-string](https://npm.io/package/is-string.md) ^1.0.5
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.29
- [object-path](https://npm.io/package/object-path.md) ^0.11.5
- [recursive-readdir-sync](https://npm.io/package/recursive-readdir-sync.md) ^1.0.6

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.7.31 (latest) — 2022-10-20
- 1.7.30 — 2022-05-31
- 1.7.29 — 2022-05-27
- 1.7.28 — 2022-05-27
- 1.7.27 — 2022-05-27
- 1.7.26 — 2022-05-26
- 1.7.25 — 2022-05-26
- 1.7.24 — 2022-05-26
- 1.7.22 — 2022-05-21
- 1.7.21 — 2022-05-17
- 1.7.20 — 2022-04-28
- 1.7.19 — 2022-04-23
- 1.7.18 — 2021-11-07
- 1.7.17 — 2021-11-05
- 1.7.16 — 2021-11-05
- … 95 more at https://npm.io/package/generic-text-linker/versions

## README

<!--- destination qa rewrite begin -->
### QA dsl-toolkit
[![CI](https://github.com/dsl-toolkit/dsl-toolkit/actions/workflows/test.yml/badge.svg)](https://github.com/dsl-toolkit/dsl-toolkit/actions/workflows/test.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/a0e903d579b8ebebaf18/maintainability)](https://codeclimate.com/github/dsl-toolkit/dsl-toolkit/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a0e903d579b8ebebaf18/test_coverage)](https://codeclimate.com/github/dsl-toolkit/dsl-toolkit/test_coverage)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdsl-toolkit%2Fdsl-toolkit.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdsl-toolkit%2Fdsl-toolkit?ref=badge_shield)[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
<!--- destination qa rewrite end -->

# Installation
```bash
npm install generic-text-linker --save-dev
```

# Motivation
I wanted to have a small generic linker solution for text files so that I can avoid
copy and paste, and use it different kind of automation tasks.


# Usage
I present the usage of the library with the example below

## Example

markdownFile1:
```markdownFile

<!-- source begin-->
Your projects badges, or information you want to share in other files without
copy and paste on your own.
<!-- source end-->

```

markdownFile2:
```markdownFile

<!-- destination begin-->
<!-- destination end-->

```

code:
```javascript 1.6
const {linkerDir} = require('generic-text-linker')
const projectRoot = 'path to the directory where you want to use the linker.'

const source = {
  begin: '<!-- source begin-->',
  end: '<!-- source end-->'
}

const destination = {
  begin: '<!-- destination begin-->',
  end: '<!-- destination end-->'
}

let sourceData = linkerDir(projectRoot, sourceTags.begin, sourceTags.end)

const changedFilesArray = linkerDir(projectRoot, destination.begin, destination.end, sourceData)

```
This will change the content of markdownFile2

# More information
This library helps you find changes modifications between your working and original fixture files. More examples are coming for more information; please check the [tests](./tests/tests)

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