richtr / guessLanguage.js

A natural language detection library based on trigram statistical analysis for Node.js and the Web.
http://richtr.github.com/guessLanguage.js/
213 stars 39 forks source link

Strange exports of module in node #3

Open clemsos opened 11 years ago

clemsos commented 11 years ago

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