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

node module with hyphens #29

Open
slicc opened this issue Nov 1, 2015 · 1 comment
Open

node module with hyphens #29

slicc opened this issue Nov 1, 2015 · 1 comment

Comments

@slicc
Copy link

slicc commented Nov 1, 2015

When a node module has hyphens I can't inject it. E.g. documentdb-q-promises, when I add this as a parameter to my module I get a js issue. Is there any way to inject node modules with hyphens?

@thejinxters
Copy link

@slicc -- I know this is a bit late, but the ['@require'] annotation injects your dependencies in the order you specify

Here is an example:

exports = module.exports = (authController, passport, bearer) ->
  BearerStrategy  = bearer.Strategy
  # Bearer Strategy for Token-based Auth
  passport.use 'bearer', new BearerStrategy (token, done) ->
    authController.validToken(token, done)

  return passport

exports['@require'] = ['controllers/auth_controller','passport', 'passport-http-bearer']

So in this example, passport-http-bearer maps directly to bearer because it is the 3rd dependency listed.

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

2 participants