npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tinyld

v1.3.4

Published

Simple and Performant Language detection library (pure JS and zero dependencies)

Downloads

87,088

Readme

TinyLD

npm npm CDN Download License

logo

:tada: Description

Tiny Language Detector, simply detect the language of a unicode UTF-8 text:

  • Pure JS, No api call, No dependencies (Node and Browser compatible)
  • Blazing fast and low memory footprint (unlike ML methods)
  • Train with dataset from Tatoeba and UDHR
  • Support 62 languages (24 for the web version)
  • Reliable even for really short texts (chatbot, keywords, ...)
  • Support both ISO-639-1 & ISO-639-2
  • Available for NodeJS (CommonJS and ESM), Deno and Browser

Links


:floppy_disk: Getting Started

Install

yarn add tinyld # or npm install --save tinyld

Install Documentation


:page_facing_up: TinyLD API

import { detect, detectAll } from 'tinyld'

// Detect
detect('これは日本語です.') // ja
detect('and this is english.') // en

// DetectAll
detectAll('ceci est un text en francais.')
// [ { lang: 'fr', accuracy: 0.5238 }, { lang: 'ro', accuracy: 0.3802 }, ... ]

API Documentation


:paperclip: TinyLD CLI

tinyld This is the text that I want to check
# [ { lang: 'en', accuracy: 1 } ]

More Information


:chart_with_upwards_trend: Performance

Here is a comparison of Tinyld against other popular libraries.

SVG Graph

To summary in one sentence:

Better, Faster, Smaller

More Benchmark Information


Developer

You want to Contribute or Open a PR, it's recommend to take a look at the dev documentation