An VFM parser implementation with TypeScript.
etc | ||
src | ||
test | ||
test-d | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
api-extractor.json | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
jest.config.ts | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json |
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.