npm-bookmark-parser

Parses Chrome bookmarks file into JSON format

npm install npm-bookmark-parser
3 downloads in the last week
9 downloads in the last month

npm-bookmark-parser

Node plugin to parse Chrome bookmarks into usable JSON format, via javascript.

Installing

npm install npm-bookmark-parser

Testing

grunt test

Usage

CoffeeScript

"use strict"
grunt = require("grunt")
parser = require("../index")
exports.nodeunit = 
    test_1: (test) ->
        test.expect 1
        parser("./test_subjects/chrome_bookmark.html",(results)->
            console.dir results
            test.ok true, "this had better work."
            test.done()
        )
    test_2: (test) ->
        test.expect 1
        parser("./test_subjects/chrome_bookmark2.html",(results)->
            console.dir results
            test.ok true, "this had better work."
            test.done()
        )

JavaScript

// Generated by CoffeeScript 1.6.2
"use strict";
var grunt, parser;

grunt = require("grunt");

parser = require("../index");

exports.nodeunit = {
  test_1: function(test) {
    test.expect(1);
    return parser("./test_subjects/chrome_bookmark.html", function(results) {
      console.dir(results);
      test.ok(true, "this had better work.");
      return test.done();
    });
  },
  test_2: function(test) {
    test.expect(1);
    return parser("./test_subjects/chrome_bookmark2.html", function(results) {
      console.dir(results);
      test.ok(true, "this had better work.");
      return test.done();
    });
  }
};

Example Output

[ { url: 'http://sourceforge.net/',
    name: 'SourceForge - Download, Develop and Publish Free Open Source Software',
    add_date: '1369192367',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://opensource.org/',
    name: 'The Open Source Initiative | Open Source Initiative',
    add_date: '1369192371',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://opensource.org/osd-annotated',
    name: 'The Open Source Definition (Annotated) | Open Source Initiative',
    add_date: '1369192373',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://www.osalt.com/',
    name: 'Find Open Source Alternatives to commercial software | Open Source Alternative - osalt.com',
    add_date: '1369192373',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://www.w3.org/Status.html',
    name: 'W3C Open Source Software',
    add_date: '1369192374',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://git-scm.com/',
    name: 'Git',
    add_date: '1369192375',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://git-scm.com/downloads',
    name: 'Git - Downloads',
    add_date: '1369192376',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://git-scm.com/documentation',
    name: 'Git - Documentation',
    add_date: '1369192376',
    tags: [ 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://en.wikipedia.org/wiki/Open-source_software',
    name: 'Open-source software - Wikipedia, the free encyclopedia',
    add_date: '1369192349',
    tags: [ 'Wiki', 'OpenSource', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://www.gnu.org/distros/free-distros.html',
    name: 'List of Free GNU/Linux Distributions - GNU Project - Free Software Foundation',
    add_date: '1369192418',
    tags: [ 'linux', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://en.wikipedia.org/wiki/Linux',
    name: 'Linux - Wikipedia, the free encyclopedia',
    add_date: '1369192419',
    tags: [ 'linux', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://downloadlinuxfree.com/',
    name: 'Download Linux Free',
    add_date: '1369192421',
    tags: [ 'linux', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://fedoraproject.org/',
    name: 'Fedora Project Homepage',
    add_date: '1369192422',
    tags: [ 'linux', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://www.ubuntu.com/index_asus.html',
    name: 'The world\'s most popular free OS | Ubuntu',
    add_date: '1369192402',
    tags: [ 'ubuntu', 'linux', 'Bookmarks Bar', 'Bookmarks' ] },
  { url: 'http://www.askubuntu.com',
    name: 'Hottest Questions This Month - Ask Ubuntu',
    add_date: '1369192405',
    tags: [ 'ubuntu', 'linux', 'Bookmarks Bar', 'Bookmarks' ] } ]

License

MIT License

http://aponxi.mit-license.org/

npm loves you