
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Parse meta Markdown data and render in the browser or server. Transform this:
Optional Heading
================
title: page1.md
tags: test
The two newlines preceding this paragraph are important.
into this:
{ title: 'page1.md',
tags: 'test',
body: '<h1>Optional Heading</h1><p>The two newlines preceding this paragraph are important.</p>' }
npm install metamd
<script type="text/javascript" src="metamd.client.min.js"></script>
var fs = require('fs');
var metamd = require('metamd');
var parsed = metamd(fs.readFileSync('./example/page1.md', 'utf-8'));
console.log(parsed.getData());
console.log(parsed.getHtml());
Will result in:
> { title: 'page1.md',
tags: 'test',
body: 'Page 1\n=\n\nThis is a _test_.\n\n```\nThis is another test\n```' }
> <h1>Page 1
</h1>
<p>This is a <em>test</em>.
</p>
<pre><code>This is another test</code></pre>
metamd(<markdown>)
Returns an instance of Metamd
.
Metamd.getData([key])
Returns an object containing the meta data. If key
is provided, just that value will be returned.
Metamd.getMarkdown()
Returns the markdown absent of the meta data.
Metamd.getHtml()
Returns html rendered using marked.
NOTE: Meta data keys should be alphanumneric plus underscores. Nothing else will be parsed. Also be careful not to use reserved words or _body
as keys.
Testing is done with mocha and chai and can be run on the server or client. Remember to install the dev dependencies before running the tests.
npm test
Navigate to test/browser/index.html
.
If you make changes, you need to recompile for browser usage. After you install the dev dependencies, it's easy:
npm run compile
FAQs
Parse out meta data from your markdown content
We found that metamd 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.