
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
detectlanguage
Advanced tools
Node.js wrapper for the Detect Language API.
npm install detectlanguage [--save]
Before using Detect Language API client you have to setup your personal API key. You can get it by signing up at detectlanguage.com
var DetectLanguage = require('detectlanguage');
var detectlanguage = new DetectLanguage('YOUR API KEY');
Takes a text string and returns a list of detections.
var text = "Hello! How are you?";
detectlanguage.detect(text).then(function(result) {
console.log(JSON.stringify(result));
});
[
{
"language": "en",
"isReliable": true,
"confidence": 18.2
}
]
Takes an array of texts and returns a list of detections. It is much faster than doing request for each text individually.
var texts = ['šešios žąsys', 'Strč prst skrz krk'];
detectlanguage.detect(texts).then(function(result) {
console.log(JSON.stringify(result));
});
[
[
{
"language": "lt",
"isReliable": true,
"confidence": 5.5
}
],
[
{
"language": "cs",
"isReliable": true,
"confidence": 3.645
},
...
]
]
Returns first detected language code.
var text = "Hello! How are you?";
detectlanguage.detectCode(text).then(function(result) {
console.log(JSON.stringify(result));
});
"en"
Returns the list of supported languages.
detectlanguage.languages().then(function(result) {
console.log(JSON.stringify(result));
});
[
{
code: "aa",
name: "AFAR"
},
{
code: "ab",
name: "ABKHAZIAN"
},
{
code: "af",
name: "AFRIKAANS"
}
...
]
Returns information about your account and it's status.
detectlanguage.userStatus().then(function(result) {
console.log(JSON.stringify(result));
});
{
date: "2020-01-01",
requests: 31,
bytes: 429,
plan: "FREE",
plan_expires: null,
daily_requests_limit: 1000,
daily_bytes_limit: 1048576,
status: "ACTIVE"
}
Laurynas Butkus (GitHub)
Licensed under the MIT License: https://opensource.org/licenses/MIT
FAQs
Detect Language API Node.js Client
The npm package detectlanguage receives a total of 3,916 weekly downloads. As such, detectlanguage popularity was classified as popular.
We found that detectlanguage 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.