https://github.com/arun-1993/subtitle-converter
A simple command line tool to convert subtitle format
https://github.com/arun-1993/subtitle-converter
npm-package subtitle subtitle-conversion typescript
Last synced: 5 months ago
JSON representation
A simple command line tool to convert subtitle format
- Host: GitHub
- URL: https://github.com/arun-1993/subtitle-converter
- Owner: arun-1993
- License: isc
- Created: 2025-01-06T16:01:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-20T14:39:32.000Z (over 1 year ago)
- Last Synced: 2025-04-12T23:35:46.419Z (over 1 year ago)
- Topics: npm-package, subtitle, subtitle-conversion, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@arun-1993/subtitle-converter
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Subtitle Format Converter
A simple command-line tool to convert subtitle files between different formats. Currently, it supports converting between **.vtt** (WebVTT) and **.srt** (SubRip Subtitle) formats.
## Installation
Install the Subtitle Format Converter globally using npm:
```bash
npm i -g @arun-1993/subtitle-converter
```
Alternatively, you can clone the repository and build it locally:
```bash
git clone https://github.com/arun-1993/Subtitle-Converter.git
cd Subtitle-Converter
npm i
npm run build
npm i -g
```
## Usage
Once installed, you can use the `convertsubtitle` command to convert subtitles:
```bash
convertsubtitle sourcefile destinationfile
```
- **sourcefile**: The input subtitle file.
- **destinationfile**: The output subtitle file.
If you do not specify a destination file, the tool will automatically determine the destination filename based on the source file’s extension:
- If the source is `.srt`, the output will be `.vtt`.
- If the source is `.vtt` or any other file type, the output will be `.srt`.
### Example
Convert a `.srt` file to `.vtt`:
```bash
convertsubtitle example1.srt example2.vtt
```
Convert a `.vtt` file to `.srt` (without specifying a destination file):
```bash
convertsubtitle example.vtt
```
This will create `example.srt` in the same directory.
## License
This project is licensed under the ISC License - see the [LICENSE](./LICENSE.txt) file for details.
## Contributing
Contributions are welcome! Please fork this repository, create a branch, and submit a pull request.
---
For more information or to report issues, visit the [GitHub repository](https://github.com/arun-1993/Subtitle-Converter).