new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

commands/add

18 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

nuxt add command syntax

The nuxt add command scaffolds an entity into a Nuxt application. The syntax is: npx nuxt add <TEMPLATE> <NAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--force]

nuxt add TEMPLATE argument options

The TEMPLATE argument specifies which template to generate. Available options are: api, app, app-config, component, composable, error, layer, layout, middleware, module, page, plugin, server-middleware, server-plugin, server-route, or server-util.

nuxt add NAME argument

The NAME argument specifies the name of the generated file.

nuxt add --force option

The --force option forces override of a file if it already exists. Default is false.

nuxt add template modifiers

Some templates support additional modifier flags to add a suffix like .client or .get to their name.

nuxt add component modifiers

The component template supports modifier flags: --mode client|server, or --client, or --server. Example: npx nuxt add component TheHeader generates app/components/TheHeader.vue

nuxt add composable example

Example: npx nuxt add composable foo generates app/composables/foo.ts

nuxt add layout example

Example: npx nuxt add layout custom generates app/layouts/custom.vue

nuxt add plugin modifiers

The plugin template supports modifier flags: --mode client|server, or --client, or --server. Example: npx nuxt add plugin analytics generates app/plugins/analytics.ts

nuxt add plugin client modifier example

Example: npx nuxt add plugin sockets --client generates /plugins/sockets.client.ts

nuxt add page examples

Examples: npx nuxt add page about generates app/pages/about.vue. npx nuxt add page "category/[id]" generates app/pages/category/[id].vue

nuxt add middleware modifiers

The middleware template supports the --global modifier flag. Example: npx nuxt add middleware auth generates app/middleware/auth.ts

nuxt add api modifiers

The api template supports modifier flags: --method (accepting connect, delete, get, head, options, patch, post, put, or trace) or alternatively direct method flags like --get, --post, etc. Example: npx nuxt add api hello generates server/api/hello.ts

nuxt add layer example

Example: npx nuxt add layer subscribe generates layers/subscribe/nuxt.config.ts

nuxt module add command syntax

The `nuxt module add` command installs Nuxt modules in your application. Syntax: `npx nuxt module add <MODULENAME> [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--skipInstall] [--skipConfig] [--dev]`. The MODULENAME argument allows specifying one or more modules to install by name, separated by spaces.

nuxt module add options

The `nuxt module add` command accepts the following options: `--cwd=<directory>` (default: `.`) to specify the working directory, `--logLevel=<silent|info|verbose>` to specify build-time log level, `--skipInstall` to skip npm install, `--skipConfig` to skip nuxt.config.ts update, and `--dev` to install modules as dev dependencies.

nuxt module add behavior

When running `nuxt module add`, the command installs the module as a dependency using your package manager, adds it to your package.json file, and updates your nuxt.config file.

nuxt module add example: pinia

To install the Pinia module, run: `npx nuxt module add pinia`

Give your agent this brain