nginx / nginx/njs-examples

Example using node modules with njs

Open
#19 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
694
Forks
82
PR merge metrics
No merged PRs in 30d

Description

Thanks for all these nice examples.

Can you please also create an example for using 3rd party node modules? Or is it still supported after the removal of the js_include directive?

I've been following this guide, however, it doesn't seem to work.
https://nginx.org/en/docs/njs/node_modules.html

Is the guide for using the js_include directive only? With js_include an export default {...} statement isn't needed at the end of the bundled js file. However, js_import requires this export default {...} statement, which undoes the effort by the load.js in the global namespace.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked njs node_modules guide and compare its js_include and js_import behavior with the load.js discussion in the issue. Determine whether third-party Node modules remain supported and create an example that works with the current directive requirements, including the needed export behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nginx
Domain
backend, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.