node-bookmarks-parser
v2.0.0
Published
Parse bookmarks files
Downloads
173
Readme
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)
text
stringoptions
object - an optional parameter with following fields:parser
string -netscape
(default)
Returns Bookmark[]
Objects
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.