Skip to content

Commit

Permalink
feat: support for custom PKG_NODE_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Oct 17, 2023
1 parent 62ffff2 commit 4954269
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,18 @@ review.
For example:

`yarn start --node-range node18 --arch x64 --output dist`

## Environment

| Var | Description |
| ---------------- | ------------------------------------------------------------------------------------------------------------ |
| `PKG_BUILD_PATH` | Directory to use to clone and build nodejs binaries. Default to system temporary directory |
| `PKG_CACHE_PATH` | Path to pkg-cache. Default to `~/.pkg-cache` |
| `PKG_IGNORE_TAG` | Ignore tag folder when checking local binary path |
| `PKG_NODE_PATH` | Custom path to the local nodejs binary to use |
| `HTTPS_PROXY` | Optional HTTPS proxy to use when fetching binaries |
| `HTTP_PROXY` | Optional HTTP proxy to use when fetching binaries |
| `MAKE_JOB_COUNT` | Number of parallel jobs when building binaries (value passed to `make -j` option). Default to number of cpus |
| `CFLAGS` | Flags to use when invoking C compiler |
| `CXXFLAGS` | Flags to use when invoking C++ compiler |
| `STRIP` | Path to `strip` command. Default to `strip` |
4 changes: 4 additions & 0 deletions lib/places.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export function localPlace({
}: LocalPlaceOptions) {
let binDir: string;

if(process.env.PKG_NODE_PATH) {
return path.resolve(process.env.PKG_NODE_PATH);
}

if (output) {
binDir = path.resolve(output);
} else {
Expand Down

0 comments on commit 4954269

Please sign in to comment.