Skip to content

NpmExecTask

Summary

Basic task for executing various npm commands. Extends NodeExecTask and provides access to npm 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.NpmExecTask::class) {
    ...
  }
}

Properties

Property Type Default When Kotlin plugin is present
Property CLI System/Gradle Environment
build.gradle.kts
1
2
3
4
5
6
7
8
tasks {
  register("name", dev.petuska.npm.publish.task.NpmExecTask::class) {
    doLast {
      val args = listOf("--help")
      npmExec(args)
    }
  }
}