
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
@weave-md/parse
Advanced tools
AST generation and serialization for Weave Markdown - parse markdown strings to WeaveAst and stringify back to Markdown.
@weave-md/parse provides the core parsing functionality for Weave Markdown:
weave-ast.schema.jsonThis package intentionally does not:
@weave-md/basic for that)@weave-md/basic for that)@weave-md/validate for that)npm install @weave-md/parse @weave-md/core
This package provides two parsing functions:
parseWeaveDocument(markdown) - Fast synchronous parser for simple use cases. Does not support extensions or plugins.parseWeaveDocumentAsync(markdown, options) - Full-featured async parser that supports custom syntax extensions and remark plugins (which may perform async operations).Use the sync version when you just need to parse standard Weave Markdown. Use the async version when you need custom extensions, plugins, or strict mode.
import { parseWeaveDocument } from '@weave-md/parse'
const markdown = `---
id: intro
title: Introduction
---
See [next section](node:next).
`
const ast = parseWeaveDocument(markdown)
console.log(ast.sections) // [{ id: 'intro', title: 'Introduction', body: '...' }]
console.log(ast.links) // [{ ref: { id: 'next' }, sourceId: 'intro', ... }]
import { parseToMdast } from '@weave-md/parse'
const { tree, frontmatter, diagnostics } = parseToMdast(markdown)
// tree is an mdast Root with Weave node types (weaveNodeLink, weaveMathBlock, etc.)
// frontmatter is { id, title?, peek? }
// diagnostics contains any parse-time warnings/errors
import { parseToMdast, stringifyWeaveDocument } from '@weave-md/parse'
const { tree, frontmatter } = parseToMdast(markdown)
// Modify the tree...
const output = stringifyWeaveDocument({ tree, frontmatter })
import { parseWeaveDocumentAsync } from '@weave-md/parse'
const ast = await parseWeaveDocumentAsync(markdown, {
extensions: [myCustomExtension],
plugins: [myRemarkPlugin],
strict: true // throws on errors
})
@weave-md/parse performs parse-time validation - checking syntax and structure as it parses:
id field?For document-level validation (broken references, duplicate IDs across files), use @weave-md/validate.
@weave-md/core - Core types and helpers (peer dependency)micromark + mdast-util-from-markdown - Markdown parsingmdast-util-to-markdown - Markdown stringificationMIT
FAQs
AST generation for Weave Markdown - parse markdown to WeaveAst
We found that @weave-md/parse demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.