komodojp / tinyld

Simple and Performant Language detection library for NodeJS
https://komodojp.github.io/tinyld/
MIT License
415 stars 12 forks source link

Update example import path in light.md #23

Closed urlDev closed 1 year ago

urlDev commented 1 year ago

This pull request updates the example import in docs/light.md to be compatible with exports in package.json.

kefniark commented 1 year ago

Thanks but no I confirm that the doc is right, it should be

import { detect } from 'tinyld' // use the default
import { detect } from 'tinyld/light'  // use the light version
import { detect } from 'tinyld/heavy' // use the heavy version

You shouldn't need to guess the structure of the dist folder. And using absolute file access can cause typing issues.