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

cld3

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cld3

Unofficial Node.js bindings for Compact Language Detector v3 (CLD3)

  • 2.0.5
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-17.65%
Maintainers
1
Weekly downloads
 
Created
Source

node-cld3

Unofficial Node.js bindings for Compact Language Detector v3 (CLD3).

The library exposes a getLanguages function that returns the detected languages in the provided text.

This is an unofficial wrapper around the CLD3 library. It is not affiliated with Google in any way.

Usage

Installation: npm install cld3

import { getLanguages } from 'cld3';

const langs = getLanguages(
  'This piece of text is in English. Гэты тэкст на беларускай мове.'
);

console.log(langs);
/**
 * [
 *  {
 *      language: 'be',
 *      probability: 0.9173873066902161,
 *      is_reliable: true,
 *      proportion: 0.5853658318519592
 *  },
 *  {
 *      language: 'en',
 *      probability: 0.9999790191650391,
 *      is_reliable: true,
 *      proportion: 0.4146341383457184
 *  }
 * ]
 */

Local development

  1. Ensure you are using Node.js >= 18 and have the protobuf, clang and cmake installed
  2. Install dependencies npm install
  3. Compile bindings npm run build
  4. Run the tests npm run test

or use Docker

  1. docker build . -t node-cld3:node
  2. docker run --rm -it node-cld3:node

FAQs

Package last updated on 03 Nov 2023

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