# 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'
<script type="module">
import { detect } from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/tinyld.normal.browser.js'
// ...
</script>
import { detect } from 'https://cdn.skypack.dev/tinyld'
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 }, ... ]