Package io.jooby.node

Class NodeModule

java.lang.Object
io.jooby.node.NodeModule
All Implemented Interfaces:
io.jooby.Extension
Direct Known Subclasses:
NpmModule, YarnModule

public abstract class NodeModule extends Object implements io.jooby.Extension
Base class for Npm and Yarn installer.
Since:
2.8.0
Author:
edgar
  • Method Details

    • workDirectory

      @Nonnull public NodeModule workDirectory(@Nonnull Path workDirectory)
      Set working directory (location of package.json).
      Parameters:
      workDirectory - Work directory.
      Returns:
      This module.
    • installDirectory

      @Nonnull public NodeModule installDirectory(@Nonnull Path installDirectory)
      Set install directory where to save the node executable (node/node).
      Parameters:
      installDirectory - Location where to save the node executable (node/node).
      Returns:
      This module.
    • execute

      @Nonnull public NodeModule execute(@Nonnull String cmd, @Nonnull String... args)
      Execute a node task (without blocking the caller thread).
      Parameters:
      cmd - Command.
      args - Arguments.
      Returns:
      This module.
    • executeOnce

      @Nonnull public NodeModule executeOnce(@Nonnull String cmd, @Nonnull String... args)
      Run a task once per JVM instance. Specially created for joobyRun to supports application restart (hot reload) and long running node processes (like a web server).
      Parameters:
      cmd - Command.
      args - Arguments.
      Returns:
      This module.
    • install

      public void install(@Nonnull io.jooby.Jooby application) throws Exception
      Specified by:
      install in interface io.jooby.Extension
      Throws:
      Exception