https://github.com/realabbas/srt-convert-json
Convert SRT data file 📂 to JSON
https://github.com/realabbas/srt-convert-json
json npm-package srt srt-convert-json srt-files srt-subtitles srt-to-json srt2json subtitle-conversion subtitles
Last synced: 3 months ago
JSON representation
Convert SRT data file 📂 to JSON
- Host: GitHub
- URL: https://github.com/realabbas/srt-convert-json
- Owner: realabbas
- Created: 2021-01-19T11:29:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-08T16:49:41.000Z (about 4 years ago)
- Last Synced: 2025-01-15T18:41:22.756Z (5 months ago)
- Topics: json, npm-package, srt, srt-convert-json, srt-files, srt-subtitles, srt-to-json, srt2json, subtitle-conversion, subtitles
- Language: JavaScript
- Homepage:
- Size: 110 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert SRT to JSON Format
[](https://www.npmjs.com/package/srt-convert-json)
[](https://www.npmjs.com/package/srt-convert-json)
This npm package converts a SRT SubRip File (Subtitle File) into JSON format.
## Package Install Instructions
```
$ npm install srt-convert-json
```## Usage
```js
const convert = require('srt-convert-json')convert.process("INPUT_FILE_PATH","OUTPUT_FILE_PATH")
// convert.process("./data.srt","./subtitle.json")
```For Example, this is an SRT File
```
1
00:02:38,910 --> 00:02:40,161
English! I'm English!2
00:05:40,049 --> 00:05:41,801
It's grenadiers, mate.
```After converting, the output will be
```
[
{
"position": 1,
"start": "00:02:38",
"timer1": "910",
"end": "00:02:40",
"timer2": "161",
"text": "English! I'm English!"
},
{
"position": 2,
"start": "00:05:40",
"timer1": "049",
"end": "00:05:41",
"timer2": "801",
"text": "It's grenadiers, mate."
},
]
```