flatten-chrome-bookmark-child

1.0.0 • Public • Published

This simple function is used to transform the google chrome tree bookmarks into an array to make it easier to work with.

For instance, this function can be used to process the Google Chrome function chrome.bookmarks.get (see https://developer.chrome.com/extensions/bookmarks#method-get).

This can also process directly the file stored by Google Chrome.

On my linux machine, this file is located here:

~/.config/google-chrome/Default/Bookmarks

Here is an example on how to use this function on that file:

const { readFile } = require('fs');
// change this variable with your actual path to the file
const filepath = '/home/<myhome>/.config/google-chrome/Default/Bookmarks';
const bookmarks = readFile(filepath, 'utf-8', function(err, bookmarksString) {
  const bookmarksList = getChromeBookmarks(JSON.parse(bookmarksString));
  // do whatever you want with it
  console.log('bookmarksList', bookmarksList);
});

Readme

Keywords

none

Package Sidebar

Install

npm i flatten-chrome-bookmark-child

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.59 kB

Total Files

4

Last publish

Collaborators

  • goaman