var-finder-md

1.1.4 • Public • Published

var-finder-md

A tool for finding and managing variables in Markdown files.

Using npm:

npm i var-finder-md

Markdown structure

---
var1: Example
var2: 150
---

Output

[
 {
   var1: 'Example',
   var2: 150,
 },
]

In Node.js:

const varFinder = require('var-finder-md')

console.log(varFinder('./<FOLDER_PATH>}'))

Example

📁Project
├───📁docs
│   ├───📁Sections
│   │     Start.md
│   │     Usage.md
│   ├───📁Subsections
│   │     Start_1.md
│   │     Start_2.md
│   │     Usage_2.md
│   │     Usage_2.md
├───package-lock.json
├───package.json
├───script.js

script.js:

const varFinder = require('var-finder-md')

sectionFiles = varFinder('./docs/Sections')
subsectionFiles = varFinder('./docs/Subsections')

console.log(sectionFiles)
console.log(subsectionFiles)

Output:

[
  {
    filename: 'Start',
    variables: { title: 'Start', navbar_position: 0 }
  },
  {
    filename: 'Usage',
    variables: { title: 'Usage', navbar_position: 0 }
  }
]
[
  {
    filename: 'Start_1',
    variables: { title: 'Windows', navbar_position: 0 }
  },
  {
    filename: 'Start_2',
    variables: { title: 'Linux', navbar_position: 0 }
  },
  {
    filename: 'Usage_1',
    variables: { title: 'React', navbar_position: 0 }
  },
  {
    filename: 'Usage_2',
    variables: { title: 'Vue', navbar_position: 0 }
  }
]

Readme

Keywords

none

Package Sidebar

Install

npm i var-finder-md

Weekly Downloads

0

Version

1.1.4

License

ISC

Unpacked Size

2.59 kB

Total Files

3

Last publish

Collaborators

  • half_bellboy