# videojs-languages **Repository Path**: mirrors_videojs/videojs-languages ## Basic Information - **Project Name**: videojs-languages - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [videojs-languages](#videojs-languages) - [Installation](#installation) - [CLI Usage](#cli-usage) - [Specifying a Destination Directory](#specifying-a-destination-directory) - [Create as an ES module](#create-as-an-es-module) - [Options](#options) - [API Usage](#api-usage) - [License](#license) # videojs-languages [![Build Status](https://travis-ci.org/videojs/videojs-languages.svg?branch=master)](https://travis-ci.org/videojs/videojs-languages) [![Greenkeeper badge](https://badges.greenkeeper.io/videojs/videojs-languages.svg)](https://greenkeeper.io/) [![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com) [![NPM](https://nodei.co/npm/videojs-languages.png?downloads=true&downloadRank=true)](https://nodei.co/npm/videojs-languages/) A CLI program for converting [video.js JSON language files](https://github.com/videojs/video.js/blob/master/docs/guides/languages.md#creating-the-language-file) into [executable video.js language definitions](https://github.com/videojs/video.js/blob/master/docs/guides/languages.md#adding-languages-to-videojs). ## Installation ```sh $ npm install -g videojs-languages ``` This will install the `vjslang` binary on your `$PATH`. ## CLI Usage The `vjslang` binary takes any number of [glob-like arguments](https://www.npmjs.com/package/minimatch) for targeting `.json` files: ```sh $ vjslang **/*.json foo/bar/*.json ``` If no glob arguments are given, for example: ```sh $ vjslang ``` The program will fall back to `lang/*.json`. ### Specifying a Destination Directory By default, each converted `.js` file will be output alongside its source `.json` file, but a `--dir`/`-d` option can be used to specify a directory where _all_ `.js` file(s) will end up: ```sh $ vjslang foo/bar.json --dir baz ``` The directory will be created if it does not exist. If creation fails, `vjslang` will fall back to its default behavior. ### Create as an ES module The `--asModule`/`-m` option creates an .mjs moduel file which can be directly imported. ```sh $ vjslang foo/bar.json --dir baz --asModule ``` ### Options The `--dir`/`-d` and `--asModule`/`-m` options are the most interesting/useful. For full option documentation refer to: ```sh $ vjslang --help ``` ## API Usage There is a very simple programmatic API that can be used in your own programs. It is used like this: ```js import convert from 'videojs-languages'; const asModule = true; convert(['foo/bar.json', 'baz/*.json'], 'langs', asModule); ``` ## License Apache-2.0