https://github.com/calibr/node-bookmarks-parser
Parses Firefox/Chrome HTML bookmarks files
https://github.com/calibr/node-bookmarks-parser
bookmark netscape pocket
Last synced: 19 days ago
JSON representation
Parses Firefox/Chrome HTML bookmarks files
- Host: GitHub
- URL: https://github.com/calibr/node-bookmarks-parser
- Owner: calibr
- Created: 2015-03-05T17:46:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-18T15:54:47.000Z (almost 6 years ago)
- Last Synced: 2025-03-15T00:25:36.263Z (about 1 month ago)
- Topics: bookmark, netscape, pocket
- Language: HTML
- Homepage:
- Size: 976 KB
- Stars: 53
- Watchers: 1
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
- project-awesome - calibr/node-bookmarks-parser - Parses Firefox/Chrome HTML bookmarks files (HTML)
- jimsghstars - calibr/node-bookmarks-parser - Parses Firefox/Chrome HTML bookmarks files (HTML)
README
', function(err, res) {[](https://travis-ci.org/calibr/node-bookmarks-parser)
# Parse bookmarks files
This library can parse formats listed below:
- Netscape Bookmarks(Firefox, Google Chrome, ...)
- Pocket(http://getpocket.com)## Installation
`npm install bookmarks-parser`
Example:
```javascript
var parse = require("bookmarks-parser");
parse('Pocket ExportUnread
'+
'
console.log(err);
console.log(res.parser);
console.log(res.bookmarks);
});
```
`parse` function receives two parameters - text of a exported bookmarks file and callback.
Second parameter returned in the callback is an object with fields:
- `parser` - `netscape` or `pocket`
- `bookmarks` - an array of parsed bookmarks
Each bookmark is an object with fields:
- `type` - `folder` or `bookmark`
- `title` - title of a bookmark or a folder
- `url` - URL only for bookmarks
- `children` - array of children bookmarks, only for folders
- `ns_root` - if the folder is a root this field will contain one of the values: `menu`, `toolbar`, `unsorted`, otherwise `null`. Applicable only for `netscape` parser.
If you have found out any bugs or have any questions please feel free to submit it into the issues.
See more examples in the tests.