Closed rektide closed 9 years ago
Agreed, and I think plugins should be the same way. This would also allow you to pass in configuration for both the parser and plugins.
Added support for multiple instances of Knwl.js (and plugins): 541bf35d9cd1604eff34e83d08de99abcccd5fa0
@loadfive sorry for not getting back sooner, but for plugins I was imagining you'd do something like this:
knwl.register('places', require('./default_plugins/places')())
knwl.register('places-en', require('./default_plugins/places')({ locale: 'en' }))
Which would allow you to pass configuration to plugins and also register the same plugin multiple times with different configurations.
Presently all functionality stems from data stored on the rootmost require('knwl') object. This makes it impossible to have more than one parse running at a time. I would like to see the ability to instantiate individual parser instances each parsing different strings.