richtr/guessLanguage.js

Strange exports of module in node

Opened this issue · 0 comments

After install with NPM npm install guesslanguage
I have strange behaviour when importing.
Seems like the module exports a JS object so i have to duplicate and write guessLanguage.guessLanguage.detect

here an example in coffeescript

guessLanguage = require 'guesslanguage'
guessLanguage.guessLanguage.detect text, (language) ->
        console.log "language is : "+language