2.0.0 • Published 6 years ago
node-bookmarks-parser v2.0.0
node-bookmarks-parser
This library can parse following formats:
- Netscape Bookmarks (Google Chrome)
Installation
npm install node-bookmarks-parser
Example:
import parse from "node-bookmarks-parser";
try {
const html = ...;
const bookmarks = parse(html);
} catch (e) {
console.error(e);
}Documentation
Methods
parse(text: string, options?: Options)
textstringoptionsobject - an optional parameter with following fields:parserstring -netscape(default)
Returns Bookmark[]
Objects
Bookmark
typestring -folderorbookmarktitlestring - title of a bookmark or a folderurlstring - URL only for bookmarkschildrenBookmark[]- array of children bookmarks, only for foldersaddDatestringlastModifiedstringiconstring - favicon in a base64 encoded stringnsRootstring - if the folder is a root this field will contain one of the values:menu,toolbar,unsorted, otherwisenull. Applicable only fornetscapeparser.