node-parse-bookmarks
v1.0.3
Published
Parse bookmarks files
Downloads
57
Readme
node-parse-bookmarks
This library can parse following formats:
- Netscape Bookmarks (Google Chrome)
Installation
npm install node-parse-bookmarks
Example:
import parse from "node-parse-bookmarks";
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.