# nodejsRuntimeDir
This is an optional argument that tells the yc-360 script where to look for the yCrash Node.js hook's runtime files, such as its registration file and access token, when they aren't in the default location.
Type: string
Default: the system's temp directory
Usage:
- Omitted: the script looks for the hook's runtime files in the same default temp directory the hook itself falls back to.
- Specified: the script looks in the directory you provide instead.
How it works:
- The hook stores a small amount of local state while it runs: a registration file the yc-360 script uses to find it, and an access token used to authenticate requests.
- By default, both the hook and the yc-360 script use the system's temp directory for this. That's fine for testing, but in production you may want a dedicated, access controlled directory instead, particularly if the yc-360 script runs as a different system user than your application.
- To use a dedicated directory, set it on both sides: as the
YC360_NODE_RUNTIME_DIRenvironment variable on your Node.js application, and as this argument (or the same environment variable) on the yc-360 script. - Both sides must resolve to the exact same directory, or the script won't be able to find the hook's registration file.
Example (YAML):
options:
onlyCapture: true
appRuntime: nodejs
nodejsRuntimeDir:
- /var/run/yc360/node
1
2
3
4
5
2
3
4
5
Example (CLI):
./yc -onlyCapture -p 22534 -appRuntime=nodejs -nodejsRuntimeDir=/var/run/yc360/node
1