1.0.6 • Published 4 years ago

bookmark-file-parser v1.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

bookmark-file-parser

Parse Firefox/Chrome/IE/Safari HTML bookmarks files

install

npm i bookmark-file-parser -S

use

import { parseByPath, parseByString } from "bookmark-file-parser"
import { readFileSync } from "fs"

const dirname = "./chrome.html"

const data1 = parseByPath(dirname)

const content = readFileSync(dirname, "utf-8")
const data2 = parseByString(content)

output

[{
    "name": "chrome",
    "type": "folder",
    "href": "",
    "icon": "",
    "children": [{
        "name": "google",
        "type": "site",
        "href": "https://www.google.com/",
        "icon": "",
        "children": []
    }]
}]