File tree Expand file tree Collapse file tree 7 files changed +106
-0
lines changed Expand file tree Collapse file tree 7 files changed +106
-0
lines changed Original file line number Diff line number Diff line change 14
14
features :
15
15
- actionlint
16
16
- google-cloud-cli
17
+ - node
17
18
- postgresql-client
18
19
- shellcheck
19
20
baseImage :
33
34
features :
34
35
- actionlint
35
36
- google-cloud-cli
37
+ - node
36
38
- postgresql-client
37
39
- shellcheck
38
40
continue-on-error : true
Original file line number Diff line number Diff line change
1
+ # node
2
+
3
+ Install [ Node.js] ( https://nodejs.org ) from [ Nodesource's DEB repository] ( https://deb.nodesource.com ) .
4
+
5
+ ## Usage
6
+
7
+ ``` json
8
+ "features" : {
9
+ "ghcr.io/CargoSense/devcontainer-features/node:1" : {}
10
+ }
11
+ ```
12
+
13
+ ## Options
14
+
15
+ | Option ID | Description | Type | Default Value |
16
+ | :----------| :--------------------------------| :-------| :--------------|
17
+ | ` version ` | The Node.js version to install. | string | ` 22 ` |
18
+
19
+ ## OS Support
20
+
21
+ This Feature should work on recent versions of Debian/Ubuntu and Linux distributions using the [ apt] ( https://wiki.debian.org/AptCLI ) management tool.
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " Node.js" ,
3
+ "id" : " node" ,
4
+ "version" : " 1.0.0" ,
5
+ "description" : " Install Node.js from Nodesource's DEB repository." ,
6
+ "options" : {
7
+ "version" : {
8
+ "type" : " string" ,
9
+ "enum" : [
10
+ " 18" ,
11
+ " 20" ,
12
+ " 21" ,
13
+ " 22" ,
14
+ " 23"
15
+ ],
16
+ "default" : " 22" ,
17
+ "description" : " Select or enter a Node.js version."
18
+ }
19
+ },
20
+ "installsAfter" : [
21
+ " ghcr.io/devcontainers/features/common-utils"
22
+ ]
23
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ set -e
4
+
5
+ NODE_VERSION=" ${VERSION:- " 22" } "
6
+
7
+ curl_installed=" "
8
+
9
+ if ! type curl > /dev/null 2>&1 ; then
10
+ apt update --yes
11
+ apt install --no-install-recommends --yes curl ca-certificates
12
+
13
+ curl_installed=" true"
14
+ fi
15
+
16
+ curl -fsSL https://deb.nodesource.com/setup_" ${NODE_VERSION} " .x | bash -
17
+
18
+ apt update --yes
19
+ apt install --no-install-recommends --yes nodejs
20
+
21
+ if [ -n " ${curl_installed} " ]; then
22
+ apt purge curl --autoremove --yes
23
+ fi
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ # Optional: Import test library bundled with the devcontainer CLI
6
+ # shellcheck source=/dev/null
7
+ source dev-container-features-test-lib
8
+
9
+ # Feature-specific tests
10
+ check " version" bash -c " node --version | grep -E 'v20\..+'"
11
+
12
+ # Report result
13
+ reportResults
Original file line number Diff line number Diff line change
1
+ {
2
+ "node-20" : {
3
+ "image" : " debian:latest" ,
4
+ "features" : {
5
+ "node" : {
6
+ "version" : " 20"
7
+ }
8
+ }
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ # Optional: Import test library bundled with the devcontainer CLI
6
+ # shellcheck source=/dev/null
7
+ source dev-container-features-test-lib
8
+
9
+ # Feature-specific tests
10
+ check " version" node --version
11
+ check " which node" bash -c " which node | grep /usr/bin/node"
12
+
13
+ # Report result
14
+ reportResults
You can’t perform that action at this time.
0 commit comments