Skip to content

NodeExecTask

Summary

Basic task for executing various node commands. Provides access to node executable.

The task can be created and configured in a build.gradle.kts file by registering it with correct type.

build.gradle.kts
1
2
3
4
5
tasks {
  register("name", dev.petuska.npm.publish.task.NodeExecTask::class) {
    ...
  }
}

Properties

Property Type Default When Kotlin plugin is present
nodeHome DirectoryProperty NODE_HOME env variable kotlinNodeJsSetup task output
Property CLI System/Gradle Environment
nodeHome --nodeHome NODE_HOME
build.gradle.kts
1
2
3
4
5
6
7
8
9
tasks {
  register("name", dev.petuska.npm.publish.task.NodeExecTask::class) {
    nodeHome.set(layout.projectDirectory.dir("/usr/share/node"))
    doLast {
      val args = listOf("--help")
      nodeExec(args)
    }
  }
}

nodeHome

Base NodeJS directory used to extract other node executables from.