An VFM parser implementation with TypeScript.
Find a file
2025-10-30 23:07:38 +13:00
etc Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
src Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
test Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
test-d Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
.editorconfig Added the files for this package. 2024-10-04 21:20:13 +13:00
.eslintignore Added the files for this package. 2024-10-04 21:20:13 +13:00
.gitignore Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
api-extractor.json Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
CHANGELOG.md Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
CODE_OF_CONDUCT.md Added the files for this package. 2024-10-04 21:20:13 +13:00
CONTRIBUTING.md explain how to test local changes 2025-07-04 23:37:06 +12:00
eslint.config.cjs Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
jest.config.ts Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
LICENSE Initial commit 2024-10-03 03:32:57 -07:00
package.json Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
pnpm-lock.yaml Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
pnpm-workspace.yaml Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
README.md Vfm version 0.26.0 2025-10-30 23:07:38 +13:00
tsconfig.json Vfm version 0.26.0 2025-10-30 23:07:38 +13:00

vfm.js

An VFM parser implementation with fixes based on MFM.

Installation

npm i vfm-js

Usage

Please see docs for the detail.

TypeScript:

import * as mfm from 'vfm-js';

const inputText =
`<center>
Hello $[tada everynyan! 🎉]

I'm @bygul, A bot of valkyriecoms!

https://toastielab.dev/toastie_t0ast/bygul
</center>`;

// Generate a MFM tree from the full MFM text.
const mfmTree = mfm.parse(inputText);

// Generate a MFM tree from the simple MFM text.
const simpleMfmTree = mfm.parseSimple('I like the hot soup :soup:');

// Reverse to a MFM text from the MFM tree.
const text = mfm.toString(vfmTree);

Develop

1. Clone

git clone https://toastielab.dev/valkyrie-dev/vfm.js.git

2. Install packages

cd vfm.js
npm i

3. Build

npm run build

Use the interactive CLI parser

full parser:

npm run parse

simple parser:

npm run parse-simple

License

This software is released under the MIT License.