Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colage

Converted multi language meta information COuntries|LAnguages|GEnres.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

What is COLAGE?

Converted multi language meta information COuntriesLAnguagesGEnres.

Installation

npm i colage

Usage

Import the library in your code:

const colage = require('colage');

Convert country names (string) to ISO 3166-1 (array)

let iso_3166_1 = colage.co('Россия, Deutschland, 中国');
console.log(iso_3166_1); //=> [ 'RU', 'DE', 'CN' ]

Convert country ISO 3166-1 (array) to names (array)

let en_countries = colage.co([ 'RU', 'DE', 'CN' ], 'en');
console.log(en_countries);  //=> [ 'Russia', 'Germany', 'China' ]

Convert language names (string) to ISO 639-1 (array)

let iso_639_1 = colage.la('русский, deutsch, 中文');
console.log(iso_639_1); //=> [ 'ru', 'de', 'zh' ]

Convert language ISO 639-1 (array) to names (array)

let en_languages = colage.la([ 'ru', 'de', 'zh' ], 'en');
console.log(en_languages);  //=> [ 'Russian', 'German', 'Chinese' ]

Convert genre names (string) to codes (array)

let codes = colage.ge('комедия, musikalisch, 动作');
console.log(codes); //=> [ '8', '21', '1' ]

Convert genre codes (array) to names (array)

let en_genres = colage.ge([ '8', '21', '1' ], 'en');
console.log(en_genres);  //=> [ 'comedy', 'musical', 'action' ]

Convert country ISO 3166-1 (string) to languages ISO 639-1 (array)

let iso_639_1 = colage.c2l('CH'); // Switzerland
console.log(iso_639_1); //=> [ 'de', 'fr', 'it', 'rm' ]

Convert job (string) to department (string)

let department = colage.j2d('Story');
console.log(department); //=> Writing

Running tests

npm test

Keywords

FAQs

Package last updated on 09 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc