language-tags
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
language-subtag-registry | 0.3.22 | 192.49 kB | CC0-1.0 | prod | 1 |
"Language-tags" is an exceptional npm package that is primarily designed to work with IANA language tags. Its functionality is based on BCP 47 (RFC 5646) and the most recent IANA language subtag registry. The package is actively updated to keep pace with changes in the standards, ensuring it always provides accurate and up-to-date information.
In order to utilize the "language-tags" package, you first need to install it via npm: npm install language-tags
. After installation, you import it into your JavaScript file as follows:
var tags = require('language-tags');
Once imported, several methods become available to you.
For instance, to check whether a tag is valid, you can use:
tags.check('en'); // this returns true if valid, false otherwise
To search for tags and subtags based on their descriptions:
tags.search('English');
This returns an array of Subtag
and Tag
objects or an empty array if no results were found.
A full list of available methods and their usage examples can be found in the package documentation.
For comprehensive information about the "language-tags" package, you can refer to the documentation available on GitHub. The document provides an in-depth explanation of the APIs, methods, and functionalities available in the package. It also contains examples showing how to leverage the package in coding scenarios. Overall, this documentation serves as an excellent resource for learning how to use the "language-tags" package effectively.