
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
A basic and lightweight replacement for Globalize. Store ISO 639-1 language database in a JSON object, accesible as node module or by browser javascript interpret. No dependencies.
A basic and lightweight replacement for Globalize. Stores ISO 639-1 language database in a JSON object, accesible as node module or by browser javascript interpret. Without any dependencies.
From javascript the JSON object is not accesible directly. You must use this public functions:
See the test folder for use examples:
// From node the module is accesible with a simple require
var languages = require ('../languages.min.js');
var num_languages = 0;
// languages.getAllLanguageCode() return an array of all ISO 639-1 language code supported
var langscodes = languages.getAllLanguageCode();
// iterate this array
for (num_languages=0; num_languages<langscodes.length; num_languages++) {
// show a string representation of the object return by languages.getLanguageInfo(langcode)
console.log(langscodes[num_languages]);
console.log(" "+JSON.stringify(languages.getLanguageInfo(langscodes[num_languages])));
}
// show the number of languages supported
console.log("Languages supported: "+num_languages);
// test languages.isValid(langcode) function
console.log("¿isValid 'kaka' language code? "+languages.isValid('kaka'));
console.log("¿isValid 'es' language code? "+languages.isValid('es'));
<!doctype html>
<html>
<head>
<title>Test languages module</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<script src="../languages.min.js"></script>
<style>
body {
background-color: #eee;
}
.centrador {
width:700px;
margin:10px auto;
border:1px solid #ccc;
padding:20px;
background-color:#fff;
}
</style>
</head>
<body>
<div class="centrador">
<h1>Test languages module (Browser client side)</h1>
<hr />
<div id="test"></div>
</div> <!-- .centrador-->
<script>
var num_languages = 0,
text = '';
// languages.getAllLanguageCode() return an array of all ISO 639-1 language code supported
var langscodes = languages.getAllLanguageCode();
// iterate this array
for (num_languages=0; num_languages<langscodes.length; num_languages++) {
// save in text variable a string representation of the object return by languages.getLanguageInfo(langcode)
var langcode = langscodes[num_languages];
text+='<b>'+langcode+'</b> '+JSON.stringify(languages.getLanguageInfo(langcode))+'<br />';
}
// save the number of languages supported
text = '<h2>Languages supported: '+num_languages+'</h2>'+text;
// write the test result in DOM element with id='test'
document.getElementById('test').innerHTML = text;
</script>
</body>
</html>
FAQs
A basic and lightweight replacement for Globalize. Store ISO 639-1 language database in a JSON object, accesible as node module or by browser javascript interpret. No dependencies.
The npm package languages receives a total of 6,267 weekly downloads. As such, languages popularity was classified as popular.
We found that languages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.