Skip to content

Commit fb84cc8

Browse files
committed
add npm registry support
1 parent 0dcc453 commit fb84cc8

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

docs/advanced/6_imports/index.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,40 @@ import { toWords } from 'number-to-words@1';
4141
import { getVariable } from 'windmill-client@1.147.3';
4242
```
4343

44-
### Private npm registry
44+
### Private npm registry & Private npm packages
4545

46-
If you are using a private artifactory, you can set the env variable `NPM_CONFIG_REGISTRY` for the worker to the url of your artifactory. If the private registry is exposing custom certificates,`DENO_CERT` and `DENO_TLS_CA_STORE` env variables can be used as well (see [Deno documentaion](https://docs.deno.com/runtime/manual/getting_started/setup_your_environment#environment-variables) for more info on those options).
46+
![Private NPM registry](private_registry.png)
47+
48+
On EE, go to `Instance settings -> Core -> NPM Config Registry`.
49+
50+
Set the registry URL: `https://npm.pkg.github.com/OWNER` (replace `OWNER` with your GitHub username or organization name).
51+
52+
#### Private NPM packages requiring token
53+
54+
:::caution
55+
56+
Currently, deno does not support private npm packages requiring tokens (but support private npm registries). Bun however does.
57+
58+
:::
59+
60+
If a token is required, append `:_authToken=<your url>` to the URL.
61+
62+
Combining the two, you can import private packages from npm
63+
64+
```
65+
https://registry.npmjs.org/:_authToken=npm_bKZp1kOKzWsNPUvx2LpyUzIJqi2uaw23eqw
66+
```
67+
68+
If the private registry is exposing custom certificates,`DENO_CERT` and `DENO_TLS_CA_STORE` env variables can be used as well (see [Deno documentaion](https://docs.deno.com/runtime/manual/getting_started/setup_your_environment#environment-variables) for more info on those options).
4769

4870
```dockerfile
4971
windmill_worker:
5072
...
5173
environment:
5274
...
53-
- NPM_CONFIG_REGISTRY=https://registry.yarnpkg.com.
5475
- DENO_CERT=/custom-certs/root-ca.crt
5576
```
5677

57-
:::info
58-
59-
Bun runtime on Windmill does not support custom NPM registries.
60-
61-
:::
62-
6378
## Imports in Python
6479

6580
For Python, the imports are automatically parsed on saving of the script and a list of imports is generated. A dependency job is then
@@ -102,7 +117,7 @@ def main(...):
102117

103118
### Private PyPi repository
104119

105-
In addition to that, environment variables can be set to customize `pip`'s index-url and extra-index-url and certificate.
120+
In addition to that, environment variables can be set to customize `pip`'s index-url and extra-index-url and certificate.
106121
This is useful for private repositories.
107122

108123
In a docker-compose file, you would add following lines:
@@ -136,9 +151,8 @@ import (
136151

137152
For PowerShell, imports are parsed when the script is run and modules are automatically installed if they are not found in the cache.
138153

139-
e.g.:
154+
e.g.:
140155

141156
```powershell
142157
Import-Module -Name MyModule
143158
```
144-
18 KB
Loading

0 commit comments

Comments
 (0)