Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sentialx/node-bookmarks-parser
Parses Chrome HTML bookmarks files
https://github.com/sentialx/node-bookmarks-parser
bookmarks chrome netscape nodejs parser typescript
Last synced: about 2 months ago
JSON representation
Parses Chrome HTML bookmarks files
- Host: GitHub
- URL: https://github.com/sentialx/node-bookmarks-parser
- Owner: sentialx
- License: mit
- Archived: true
- Created: 2019-07-29T19:26:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:19:03.000Z (about 2 years ago)
- Last Synced: 2024-05-23T01:33:07.033Z (8 months ago)
- Topics: bookmarks, chrome, netscape, nodejs, parser, typescript
- Language: TypeScript
- Size: 105 KB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - sentialx/node-bookmarks-parser - Parses Chrome HTML bookmarks files (TypeScript)
README
# node-bookmarks-parser
This library can parse following formats:
- Netscape Bookmarks (Google Chrome)
## Installation
`npm install node-bookmarks-parser`
Example:
```typescript
import parse from "node-bookmarks-parser";try {
const html = ...;
const bookmarks = parse(html);
} catch (e) {
console.error(e);
}
```## Documentation
### Methods
#### `parse(text: string, options?: Options)`
- `text` string
- `options` object - an optional parameter with following fields:
- `parser` string - `netscape` (default)Returns [`Bookmark[]`](#bookmark)
### Objects
#### `Bookmark`
- `type` string - `folder` or `bookmark`
- `title` string - title of a bookmark or a folder
- `url` string - URL only for bookmarks
- `children` [`Bookmark[]`](#bookmark) - array of children bookmarks, only for folders
- `addDate` string
- `lastModified` string
- `icon` string - favicon in a base64 encoded string
- `nsRoot` string - if the folder is a root this field will contain one of the values: `menu`, `toolbar`, `unsorted`, otherwise `null`. Applicable only for `netscape` parser.