An VFM parser implementation with TypeScript.
Find a file
2024-10-04 21:20:13 +13:00
etc Added the files for this package. 2024-10-04 21:20:13 +13:00
src Added the files for this package. 2024-10-04 21:20:13 +13:00
test Added the files for this package. 2024-10-04 21:20:13 +13:00
test-d Added the files for this package. 2024-10-04 21:20:13 +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
.eslintrc.js Added the files for this package. 2024-10-04 21:20:13 +13:00
.gitignore Added the files for this package. 2024-10-04 21:20:13 +13:00
api-extractor.json Added the files for this package. 2024-10-04 21:20:13 +13:00
CHANGELOG.md Added the files for this package. 2024-10-04 21:20:13 +13:00
CODE_OF_CONDUCT.md Added the files for this package. 2024-10-04 21:20:13 +13:00
CONTRIBUTING.md Added the files for this package. 2024-10-04 21:20:13 +13:00
jest.config.ts Added the files for this package. 2024-10-04 21:20:13 +13:00
LICENSE Initial commit 2024-10-03 03:32:57 -07:00
package-lock.json Added the files for this package. 2024-10-04 21:20:13 +13:00
package.json Added the files for this package. 2024-10-04 21:20:13 +13:00
README.md Added the files for this package. 2024-10-04 21:20:13 +13:00
tsconfig.json Added the files for this package. 2024-10-04 21:20:13 +13:00

vfm.js

An VFM parser implementation with TypeScript.

Installation

npm i vfm-js

Usage

Please see docs for the detail.

TypeScript:

import * as vfm 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 VFM tree from the full VFM text.
const vfmTree = vfm.parse(inputText);

// Generate a VFM tree from the simple VFM text.
const simpleVfmTree = vfm.parseSimple('I like the hot soup :soup:');

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

Develop

1. Clone

git clone https://toastielab.dev/Valkyriecoms/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.