import React from 'react'; import { useRouter } from 'next/router'; import Image from 'next/image'; import Link from 'next/link'; import { Footer, Header, InlineCommand, NxUsersShowcase, } from '@nrwl/nx-dev/ui/common'; import { sendCustomEvent } from '@nrwl/nx-dev/feature-analytics'; import { useStorage } from '../lib/use-storage'; import Head from 'next/head'; export function Node() { const sectionItemList = [ { title: 'Create Nx Plugins', content: [ 'Extend the power of Nx with your own custom built plugin that uses', '[@nrwl/devkit](https://www.npmjs.com/package/@nrwl/devkit) and', '[@nrwl/node](https://www.npmjs.com/package/@nrwl/node) or the', '[@nrwl/nx-plugin](https://www.npmjs.com/package/@nrwl/nx-plugin).', ].join(' '), }, { title: 'Build APIs', content: [ 'Use the many API frameworks that are available for Node,', ' or use the ones provided by Nx for Express and Nest.', ].join(' '), }, { title: 'Open Source Tool', content: [ 'Create a workspace that puts emphasis on packages rather than', 'libs and apps by using the "npm" preset with "create-nx-workspace".\n\n', 'Use TypeScript to build out projects that can scale infinitely.', ].join(' '), }, { title: 'Nx Uses Computation Caching', content: [ 'Computation caching is a valuable way to improve performance.', 'Computing (tests, arguments, operations, etc.) is expensive and', 'time-consuming, but computation caching means you never have to rebuild', 'the same code.\n\n', 'WebPack, Jest, and TypeScript all perform computation caching.', 'Nx builds on inspiration from Bazel and similar tools, and implements', 'distributed computation caching in a way that works with any tool and', 'requires no configuration. The result is much faster builds and ', 'continuous integration.\n\n', 'In addition, when connected to Nx Cloud, you can share the computation', 'cache with everyone working on the same project.', ].join(' '), }, ]; const router = useRouter(); const { value: storedFlavor } = useStorage('flavor'); const { value: storedVersion } = useStorage('version'); return ( <> Nx and Node
{/*Intro component*/}

Nx and Node

The power and scalability of Node has helped pave the way for increasingly complex and sophisticated applications.

Using Typescript in Node applications helps dev teams code more consistently, avoid compatibility issues, and it can be used to build libraries for NPM. Unfortunately, the setup is often tedious and time consuming, and any mistakes in your configuration can grind your work to a halt.

{/*What is Nx*/}

Nx is a smart and extensible build framework that helps you develop, test, build, and scale Node applications.

Nx is a set of tools that provides a standardized and integrated development experience for all of your Node workspaces. It takes care of things like Typescript configuration and library sharing, so you can focus on other, more interesting development tasks. In addition, Nx provides...

  • API creation using Express and Nest
  • Better linting
  • Better testing
  • Support for popular community tools and frameworks
  • Nx’s own devkit for building plugins
  • And other Nx-specific features including dependency graphs, code generation, and computation caching
{/**/}
{/*Call out*/}

Get started right away by creating a modern Node workspace with Nx, or learn more about the benefits Nx provides when building Node applications.

{/*How to use Nx*/}

Create a Node Workspace
with Nx Nest or Express

Get started right away by creating a new Node workspace. If you’re using Nest run the following command in your Terminal or Command prompt:

sendCustomEvent('code-snippets', 'click', router.pathname) } />

For Express users, the command will be:

sendCustomEvent('code-snippets', 'click', router.pathname) } />
{/*More info*/}