![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Because sometimes you don't need HTML.
I needed small, reasonably performant, extendable and reliable tool to convert Markdown (GFM) to JSON. Every small markdown parser, that I've found, couldn't generate JSON; every module, capable of generating JSON, is insanely bloated. Therefore I decided to make my own. MDJ is mostly based on marked with many improvements.
import MDJ from 'mdj'
import source from 'source.md'
const mdj = MDJ()
const parsedSource = mdj.parse(source)
// OR
import { parse } from 'mdj'
import source from 'source.md'
const parsedSource = parse(source) // Note that this is less performant.
MDJ constructor accepts an optional settings argument:
interface IMDJOptions {
html?: boolean // enables HTML support, false by default
}
Parser returns an array of tokens. Each token contains at least one property - type
, which can be heading
, paragraph
, code
etc.
Other content of tokens may vary. For example tokens of types text
, code
, codeblock
and html
have a value
property, which represents the raw content of that token.
const md = '`console.log("test")`'
parse(md) //
/*
outputs
[
{
type: 'paragraph',
children: [
{
type: 'code',
value: 'console.log("test")
}
]
}
]
*/
As you would have noticed, other tokens may have the children
property, which will contain another array of tokens.
Parsers are divided into two parts:
To add new parser rule use corresponding instance method:
const blockParser = (source: string) => {/* */}
const inlineParser = (source: string) => {/* */}
const priority = 300
mdj.useBlockParser(blockParser, priority)
mdj.useInlineParser(inlineParser, priority)
Before starting the parsing process all rules are sorted by priority. You may check priorities of default parsers in the source (./src/core/MDJ.ts
)
Each parser receives from one to three parameters - source
, which is, basically, non-parsed part of the initial source, and one or two lexers (block-level and inline-level for block-level parsers and only inline-level lexer for inline-level parser). Passed lexers use the same MDJ instance and can be used to parse whatever needs to be parsed inside your parser.
Parser should return null, if it did nothing, or an object, containing a new token, which will be added to JSON and a new source. See examples in ./src/parsers
.
Support:
Performance:
MDJ is released under the MIT license.
FAQs
Markdown (GFM) to JSON converter
The npm package mdj receives a total of 0 weekly downloads. As such, mdj popularity was classified as not popular.
We found that mdj demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.