Skip to content

Parse bookmarks files with some formats(Netscape,Pocket, ...)

Notifications You must be signed in to change notification settings

team-chiru/node-bookmarks-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

#Parse bookmarks files

This library can parse formats listed below:

##Installation

npm install bookmarks-parser

Example:

var parse = require("bookmarks-parser");
parse('<title>Pocket Export</title><h1>Unread</h1>'+
      '<ul><li><a href="http://example.com">Example!</a></li></ul>', function(err, res) {
  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 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

See more examples in tests.

About

Parse bookmarks files with some formats(Netscape,Pocket, ...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 81.8%
  • HTML 18.2%