Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamidyfine/html-to-object
A simple tool that allows you to convert HTML files into JavaScript objects and write them to a JSON file.
https://github.com/hamidyfine/html-to-object
cli converter dom-manipulation html-to-json json typescript
Last synced: 9 days ago
JSON representation
A simple tool that allows you to convert HTML files into JavaScript objects and write them to a JSON file.
- Host: GitHub
- URL: https://github.com/hamidyfine/html-to-object
- Owner: hamidyfine
- License: mit
- Created: 2023-09-08T21:48:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-16T15:20:26.000Z (over 1 year ago)
- Last Synced: 2025-01-26T21:26:20.807Z (19 days ago)
- Topics: cli, converter, dom-manipulation, html-to-json, json, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/convert-html-to-object
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convert HTML to Object
The `convert-html-to-object` CLI is a simple tool that allows you to convert HTML files into JavaScript objects and write them to a JSON file. This can be useful when you want to extract structured data from HTML documents and work with it programmatically.
## Installation
You can easily install the `convert-html-to-object` CLI using npm. Open your terminal and run the following command:
```shell
npm install -g convert-html-to-object
```This will install the CLI globally on your system, allowing you to use it from anywhere.
## Usage
Once you have installed the CLI, you can use it to convert HTML files to JSON objects with the following command:
```shell
hto convert --src path/to/file.html
```- `convert`: This is the command to convert an HTML file to a JSON object.
- `--src`: Use this option to specify the path to the HTML file you want to convert.### Example
Let's say you have an HTML file named `example.html` located in the `/project` directory. To convert this file to a JSON object, you would run:
```shell
hto convert --src /project/example.html
```This will generate a JSON file in the same directory as the HTML file with the `output.json` name. The JSON file will contain the structured data extracted from the HTML document.
---
Happy converting! If you have any questions or need assistance, feel free to reach out.