This library can parse following formats:
- Netscape Bookmarks (Google Chrome)
npm install node-bookmarks-parser
Example:
import parse from "node-bookmarks-parser";
try {
const html = ...;
const bookmarks = parse(html);
} catch (e) {
console.error(e);
}
text
stringoptions
object - an optional parameter with following fields:parser
string -netscape
(default)
Returns Bookmark[]
type
string -folder
orbookmark
title
string - title of a bookmark or a folderurl
string - URL only for bookmarkschildren
Bookmark[]
- array of children bookmarks, only for foldersaddDate
stringlastModified
stringicon
string - favicon in a base64 encoded stringnsRoot
string - if the folder is a root this field will contain one of the values:menu
,toolbar
,unsorted
, otherwisenull
. Applicable only fornetscape
parser.