Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: multiiple parser instances #70

Closed
rektide opened this issue Jun 6, 2015 · 3 comments
Closed

RFE: multiiple parser instances #70

rektide opened this issue Jun 6, 2015 · 3 comments
Assignees

Comments

@rektide
Copy link

rektide commented Jun 6, 2015

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.

@marshall007
Copy link
Contributor

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.

@benhmoore benhmoore self-assigned this Jun 8, 2015
@benhmoore
Copy link
Owner

Added support for multiple instances of Knwl.js (and plugins): 541bf35

@marshall007
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants