Setup

A guide for you to setup on your project


md-to-jsonify

md-to-jsonify is an npm package that allows you to extract JSON data from Markdown files. It provides two main functions: extract and extractFromLink. The extract function extracts JSON data from the file system, while the extractFromLink function extracts JSON data from a remote link.

Installation

You can install md-to-jsonify using npm , yarn or pnpm :

npm install md-to-jsonify
Copy to clipboard

Usage

To use md-to-jsonify in your project, you need to import the desired functions.

Extract JSON data from the file system

import { extract } from 'md-to-jsonify'; const jsonData = await extract('/path/to/markdown/file.md'); console.log(jsonData);
Copy to clipboard

The extract function takes the path to the Markdown file as a parameter and returns the extracted JSON data.

import { extractFromLink } from 'md-to-jsonify'; const jsonData = await extractFromLink('https://example.com/markdown/file.md'); console.log(jsonData);
Copy to clipboard

The extractFromLink function takes the URL of the Markdown file as a parameter and returns the extracted JSON data. Note that this function is asynchronous and requires the use of await.

Examples

Here are a few examples to help you get started with md-to-jsonify.

Extracting JSON data from a local Markdown file

import { extract } from 'md-to-jsonify'; const jsonData = await extract('/path/to/markdown/file.md'); console.log(jsonData);
Copy to clipboard

Extracting JSON data from a remote Markdown file

import { extractFromLink } from 'md-to-jsonify'; const jsonData = await extractFromLink('https://example.com/markdown/file.md'); console.log(jsonData);
Copy to clipboard