var-finder-md
v1.1.4
Published
> A tool for finding and managing variables in Markdown files.
Downloads
5
Readme
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 }
}
]