🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@code-blocks/parser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-blocks/parser

Code block parser

latest
Source
npmnpm
Version
0.1.8
Version published
Maintainers
1
Created
Source

@code-blocks/parser

Parses code blocks, with or without front-matter, as JSON or DSV.

Usage

import {
  getMeta,
  parseDsv,
  parseJson,
} from '@code-blocks/parser'

getMeta

Extracts meta data from front-matter. Takes the content of a code block and returns an object with two keys meta (a JSON object with the meta data) and content (the rest of the code block).

parseDsv

Parses the content as delimiter separated values. Takes the separator as argument and returns a function that takes the content of the code block and returns an array of JSON objects.

parseJson

Parses the content as JSON. Takes the content as only argument and returns a JSON object.

FAQs

Package last updated on 07 Aug 2021

Did you know?

Socket

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