npm.io
0.3.0 • Published 6 years ago

@drodsou/tree2text

Licence
ISC
Version
0.3.0
Deps
0
Size
10 kB
Vulns
0
Weekly
0

@drodsou/tree2text

Converts object tree to text

installation

npm install @drodsou/tree2text

usage

const tree2text = require('@drodsou/tree2text');

let treeAsString = tree2text(myTree, myRender);

api

for structure of myTree and myRender parameters see index.js JSDoc comments of the funcion and the test examples in /test

examples

see /tests folder for examples of conversion to ToC, HTML, React

built-in HTML render

Note that the HTML render is included by default in /lib, you can use it just specifying passing the string html instead of the myRender object

Keywords