node-bookmarks-parser
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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 string
  • options object - an optional parameter with following fields:
    • parser string - netscape (default)

Returns Bookmark[]

Objects

Bookmark

  • type string - folder or bookmark
  • title string - title of a bookmark or a folder
  • url string - URL only for bookmarks
  • children Bookmark[] - array of children bookmarks, only for folders
  • addDate string
  • lastModified string
  • icon string - favicon in a base64 encoded string
  • nsRoot string - if the folder is a root this field will contain one of the values: menu, toolbar, unsorted, otherwise null. Applicable only for netscape parser.

Readme

Keywords

none

Package Sidebar

Install

npm i node-bookmarks-parser

Weekly Downloads

19

Version

2.0.0

License

MIT

Unpacked Size

13.3 kB

Total Files

15

Last publish

Collaborators

  • sential