Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hold-baby/bookmark-file-parser

Parse Firefox/Chrome/IE/Safari HTML bookmarks files
https://github.com/hold-baby/bookmark-file-parser

bookmark bookmark-parse bookmark-parser

Last synced: about 1 month ago
JSON representation

Parse Firefox/Chrome/IE/Safari HTML bookmarks files

Awesome Lists containing this project

README

        

# bookmark-file-parser
Parse Firefox/Chrome/IE/Safari HTML bookmarks files

## install
```cmd
npm i bookmark-file-parser -S
```
## use
```javascript
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
```javascript
[{
"name": "chrome",
"type": "folder",
"href": "",
"icon": "",
"children": [{
"name": "google",
"type": "site",
"href": "https://www.google.com/",
"icon": "",
"children": []
}]
}]
```