# yt-xml2vtt

> A tiny module to easily convert YouTube caption format from XML to VTT with ZERO dependencies

Latest version **1.2.1** (published 2022-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install yt-xml2vtt
pnpm add yt-xml2vtt
yarn add yt-xml2vtt
bun add yt-xml2vtt
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2022-10-19 |
| First published | 2020-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Aasim-A |
| Maintainers | aasim-a |
| Keywords | youtube, xml, vtt, xml2vtt, caption, yt-caption, convert, converter, yt |

## Links

- npm: https://www.npmjs.com/package/yt-xml2vtt
- Repository: https://github.com/Aasim-A/yt-xml2vtt
- Homepage: https://github.com/Aasim-A/yt-xml2vtt#readme
- Issues: https://github.com/Aasim-A/yt-xml2vtt/issues
- npm.io page: https://npm.io/package/yt-xml2vtt

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2022-10-19
- 1.2.0 — 2021-01-09
- 1.1.4 — 2020-12-26
- 1.1.3 — 2020-10-27
- 1.1.2 — 2020-08-18
- 1.1.1 — 2020-06-13
- 1.1.0 — 2020-06-13
- 1.0.3 — 2020-06-13
- 1.0.2 — 2020-06-05
- 1.0.1 — 2020-02-29
- 1.0.0 — 2020-02-28

## README

# yt-xml2vtt

A tiny module to easily convert YouTube caption format from XML to VTT with ZERO dependencies.

[![npm package](https://nodei.co/npm/yt-xml2vtt.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/yt-xml2vtt/)

# Installation

```bash
npm i -S yt-xml2vtt
```

Or for Yarn users:

```bash
yarn add yt-xml2vtt
```

# Usage

## Using Promises:

```js
const xml2vtt = require('yt-xml2vtt');

xml2vtt.Parse(xmlString)
  .then(vtt => /* DO SOMETHING WITH VTT */)
  .catch(err => console.log(`Error while converting XML to VTT : ${err}`));
```

Or you can use async await

```js
const xml2vtt = require('yt-xml2vtt');

const vtt = await xml2vtt
  .Parse(xmlString)
  .catch(err => console.log(`Error while converting XML to VTT : ${err}`));
/* DO SOMETHING WITH VTT */
```

## Using it synchronously:

```js
const xml2vtt = require('yt-xml2vtt');

try {
  const vtt = xml2vtt.ParseSync(xmlString);
  /* DO SOMETHING WITH VTT */
} catch (err) {
  console.log(`Error while converting XML to VTT : ${err}`);
}
```

# Tests

```bash
npm test
```

---
_Source: https://npm.io/package/yt-xml2vtt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
