Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bahamas10/node-netscape-bookmarks

Create a netscape format bookmarks file (works with Chrome)
https://github.com/bahamas10/node-netscape-bookmarks

Last synced: about 2 months ago
JSON representation

Create a netscape format bookmarks file (works with Chrome)

Awesome Lists containing this project

README

        

netscape-bookmarks
==================

Create a netscape format bookmarks file (works with Chrome)

Intended to be used by Node.JS.

Installation
------------

npm install netscape-bookmarks

Usage
-----

``` js
var netscape = require('netscape-bookmarks');
var bookmarks = {
'Dave Eddy': 'http://www.daveeddy.com',
'Perfume Global': 'http://www.perfume-global.com'
};

var html = netscape(bookmarks));
console.log(html);
```

results in this awful looking, netscape-compatible, html

``` html

Bookmarks

Bookmarks






Dave Eddy

Perfume Global



```

You can import this HTML into your favorite browser and it *should*
work. Consider looking into the [node urlfile](https://github.com/bahamas10/node-urlfile)
module I've written for further bookmark processing.

Examples
--------

Given

``` json
{
"Dave Eddy's Blog": "http://www.daveeddy.com",
"Perfume Global": "http://www.perfume-global.com/",
"Unfiled": {
"contents": {
"Twitter": "http://twitter.com"
}
},
"Second Folder": {
"contents": {
"Nested Folders!": {
"contents": {
"YouTube": "http://www.youtube.com",
"GitHub": "https://github.com"
}
}
}
},
"TekZoned": {
"url": "http://www.tekzoned.com",
"add_date": 1357547237,
"last_visit": 1357547238,
"last_modified": 1357547239
}
}
```

you get

``` html

Bookmarks

Bookmarks






Dave Eddy's Blog

Perfume Global

Unfiled









Twitter





Second Folder







Nested Folders!







YouTube

GitHub









TekZoned


```

Notes
-----

A website can either be a string containing the URL only, or an object with
the `url` attribute present. If the `contents` attribute is found, it is
assumed to be a folder containing more folders or websites.

License
-------

MIT License