Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 924 Bytes

install.md

File metadata and controls

56 lines (40 loc) · 924 Bytes

Getting Started

NodeJS

# for npm users
npm install --save tinyld

# for yarn users
yarn add tinyld

Then usage

const { detect } = require('tinyld')
// or ESM
import { detect } from 'tinyld'

Browser Usage (CDN)

<script type="module">
  import { detect } from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/tinyld.normal.browser.js'
  // ...
</script>

Deno (Pika CDN)

import { detect } from 'https://cdn.skypack.dev/tinyld'

API

import { detect, detectAll } from 'tinyld'
// or node: `const { detect } = require('tinyld')`

// Detect
detect('ceci est un text en francais.') // fr
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 }, ... ]

More about the API Documentation