Giter Site home page Giter Site logo

node-netscape-bookmarks's Introduction

netscape-bookmarks

Create a netscape format bookmarks file (works with Chrome)

Installation

npm install netscape-bookmarks

Usage

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

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!--This is an automatically generated file.
    It will be read and overwritten.
    Do Not Edit! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<Title>Bookmarks</Title>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="http://www.daveeddy.com">Dave Eddy</a>
<DT><A HREF="http://www.perfume-global.com">Perfume Global</a>
</DL><p>

You can import this HTML into your favorite browser and it should work. Consider looking into the node urlfile module I've written for further bookmark processing.

Examples

Given

{
  "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

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!--This is an automatically generated file.
    It will be read and overwritten.
    Do Not Edit! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<Title>Bookmarks</Title>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="http://www.daveeddy.com">Dave Eddy's Blog</a>
<DT><A HREF="http://www.perfume-global.com/">Perfume Global</a>
  <DT><H3>Unfiled</H3>
  <DL><p>
  <DT><A HREF="http://twitter.com">Twitter</a>
  </DL><p>
  <DT><H3>Second Folder</H3>
  <DL><p>
    <DT><H3>Nested Folders!</H3>
    <DL><p>
    <DT><A HREF="http://www.youtube.com">YouTube</a>
    <DT><A HREF="https://github.com">GitHub</a>
    </DL><p>
  </DL><p>
<DT><A HREF="http://www.tekzoned.com" ADD_DATE="1357547237" LAST_VISIT="1357547238" LAST_MODIFIED="1357547239">TekZoned</a>
</DL><p>

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

node-netscape-bookmarks's People

Contributors

bahamas10 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.