Skip to content

@nx/express - Generators

The @nx/express plugin provides various generators to help you create and configure express projects within your Nx workspace. Below is a complete reference for all available generators and their options.

For an overview of the plugin and setup instructions, see the @nx/express introduction.

Nx Application Options Schema.

Usage:

Terminal window
nx generate @nx/express:application [options]

Aliases: app

Arguments:

Terminal window
nx generate @nx/express:application <directory> [options]
OptionTypeDescriptionDefault
--babelJestbooleanUse babel instead ts-jest.false
--enableTypedLintingbooleanWhether to enable typed linting. For flat configs, this configures the recommended parserOptions.projectService and tsconfigRootDir. For legacy .eslintrc configs, this configures parserOptions.project. We do not enable this by default for lint performance reasons.false
--frontendProjectstringFrontend project that needs to access this application. This sets up proxy configuration.
--jsbooleanGenerate JavaScript files rather than TypeScript files.false
--keepExistingVersionsbooleanKeep existing dependencies versionstrue
--linterstringThe tool to use for running lint checks."none"
--namestringThe name of the application.
--setParserOptionsProjectbooleanDeprecated alias for enableTypedLinting.false
--skipFormatbooleanSkip formatting files.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--swcJestbooleanUse @swc/jest instead ts-jest for faster test compilation.false
--tagsstringAdd tags to the application (used for linting).
--unitTestRunnerstringTest runner to use for unit tests."none"
--useProjectJsonbooleanUse a project.json configuration file instead of inlining the Nx configuration in the package.json file.

You can get help for any generator by adding the --help flag:

Terminal window
nx generate @nx/express:<generator> --help