Socket
Socket
Sign inDemoInstall

generic-text-linker

Package Overview
Dependencies
9
Maintainers
3
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    generic-text-linker

Generic text linker for NodeJs


Version published
Maintainers
3
Install size
766 kB
Created

Readme

Source

QA dsl-toolkit

CI Maintainability Test Coverage FOSSA Statuslerna

Installation

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:


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

markdownFile2:


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

code:

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

Keywords

FAQs

Last updated on 20 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc