npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

firefox-bookmarks

v0.6.0

Published

Extract information from your Firefox bookmarks

Downloads

33

Readme

firefox-bookmarks Build status

Extract information from your Firefox bookmarks

This was built as part of the bookmarks project, GitHub hosted websites for searching through other people's bookmarks.

Getting Started

Install the module with: npm install firefox-bookmarks

// Load in raw bookmarks from Firefox backups
var rawBookmarks = require('~/.mozilla/firefox/profile-id/bookmarkbackups/bookmarks-YYYY-MM-DD.json');
/*
{
  "title": "",
  "id": 1,
  "dateAdded": 1364532555307821,
  "lastModified": 1364627167084723,
  "type": "text/x-moz-place-container",
  "root": "placesRoot",
  "children": [
    ...
*/

// Simplify and parse raw bookmarks
var BookmarkCollection = require('firefox-bookmarks');
var bookmarks = new BookmarkCollection(rawBookmarks);

// Output simplified bookmark info
bookmarks.toJSON();
/*
[
  {
    "type": "folder",
    "title": "web dev code",
    "children": [
      {
        "type": "bookmark",
        "title": "fxn/tkn - Terminal keynote presentation",
        "dateAdded": 1364532709949934,
        "lastModified": 1364532719708073,
        "description": "tkn - Terminal Keynote - A hack for terminal-based talks",
        "uri": "https://github.com/fxn/tkn"
      }, ...
    ]
  }, ...
]
*/

CLI

We also present a command line tool for usage within npm scripts or globally.

$ npm install -g firefox-bookmarks
npm http GET https://registry.npmjs.org/firefox-bookmarks
npm http 200 https://registry.npmjs.org/firefox-bookmarks
...
$ firefox-bookmarks flatten ~/.mozilla/firefox/profile-id/bookmarkbackups/bookmarks-YYYY-MM-DD.json \
    | underscore print | head
[
  {
    "title": "fxn/tkn - Terminal keynote presentation",
    "dateAdded": 1364532709949934,
    "lastModified": 1364532719708073,
    "description": "tkn - Terminal Keynote - A hack for terminal-based talks",
    "uri": "https://github.com/fxn/tkn"
  },
  {
    "title": "pedalboard.js - Open-source JavaScript framework for developing audio effects for guitars",

Documentation

firefox-bookmarks exposes BookmarkCollection as its module.exports.

new BookmarkCollection(rawBookmarks, options)

Constructor for interpretting a collection of Firefox bookmarks

  • rawBookmarks Object[] - Bookmarks saved to ~/.mozilla/firefox/profile-id/bookmarkbackups/
  • options Object - Container for flags to affect behavior
    • folders String[] - Array of whitelisted top-level folders to consume
      • If not provided, all folders will be consumed

bookmarks.toJSON()

Export internal bookmark data into simplified structure

Returns:

  • retArr Object[] - Array of bookmarks and folders

folder structure:

  • type String - Type of element (folders use folder)
  • title String - Name of the folder
  • children Object[] - Array of more folders and bookmarks

bookmark structure:

  • type String - Type of element (bookmarks use bookmark)
  • title String - Name of the folder
  • uri String - URL that was saved for the bookmark
  • dateAdded Number - Microseconds (milliseconds/1000) since Linux epoch that bookmark was added
  • lastModified Number - Microseconds since Linux epoch that bookmark was last updated
  • description String - Description if there was one provided

bookmarks.flatten()

Export compresses set of bookmark data. All folders are thrown out and all bookmarks are put into one array.

Returns:

  • retArr Object[] - Array of bookmarks
    • To save space, type is stripped from all bookmarks. Otherwise, these are the same as those in bookmarks.toJSON()

CLI

firefox-bookmarks installs a firefox-bookmarks executable. Options can be found via --help.

CLI flags (e.g. folders) are passed in as options that are passed in to the BookmarkCollection constructor.

$ firefox-bookmarks --help

  Usage: firefox-bookmarks [options] [command]

  Commands:

    to-json [filepath]     Parse a bookmarks file into simplified JSON
    flatten [filepath]     Flatten a bookmarks file into simplified bookmarks

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via grunt and test via npm test.

Donating

Support this project and others by twolfson via gittip.

Support via Gittip

Unlicense

As of Jan 21 2014, Todd Wolfson has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.