add optional globals __dirname and __filename similar to node.js
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Start with the linked Node.js documentation for the intended __dirname and __filename behavior, then locate the njs entry points that define or expose global values. Done means both globals are optionally available with behavior compatible enough for affected Node packages to locate files without failing.
Written by the indexing model from the issue text.
Description
add optional globals __dirname and __filename similar to node:
- https://nodejs.org/docs/latest/api/globals.html#__dirname
- https://nodejs.org/docs/latest/api/modules.html#__filename
This may simplify locating files relative to source code (e.g. read/write some assets close to the loaded script).
Some node packages use these globals and thus may fail
- Dominant language
- C
- Stars
- 1.6k
- Forks
- 245
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nginx/njs
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Modules: CR/LF in njs-produced nginx variablesMay be free again @xeioex claimed this 46 days ago, and no pull request is open. Opennjs
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Potential memory leak in njs_fs_fd_read error pathsPossibly taken @Shubham-Padkonde claimed this 40 days ago. Opennjs
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
contrib/ivorysql_ora/src/builtin_packages/utl_file/utl_file.c:517 - FCOPY destroys a file when source and destination are the samePossibly taken @Metastarx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
ly05010419/MacNativeGames#1848 ·
Maintainers usually reply within 1 day
-
libc++ test-suite
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
llvm/llvm-project#239851 ·
Maintainers usually reply within 1 day