π’ Using nuxi module add in Nuxt app
Usually when installing a new Nuxt module, you would do four to four steps:
- Install the package with npm / yarn / pnpm
- Add module to
modules array in nuxt.config.ts file
-
Optional Add module configuration
-
Optional Use the component or composable in your app
The command nuxi module add <MODULE_NAME> allows you to skip the second step in the list. So for modules like Nuxt Security right now, you only need to run the first step and nuxi will automatically register the module so that you can get started with the module right away.
This may not sound that great at first but if you think that by using nuxi we are able to reduce the amount of steps by 50% this sounds great!
So, we get the same result with less time and steps This is what I call great Developer Experience!
You can read more about this method here
https://nuxt.com/docs/api/commands/module
π Learn more
If you would like to learn more about Vue, Nuxt, JavaScript or other useful technologies, checkout VueSchool by clicking this link or by clicking the image below:
Vue School Link
It covers most important concepts while building modern Vue or Nuxt applications that can help you in your daily work or side projects π
β
Summary
Well done! You have just learned how to utilize nuxi in your Nuxt app.
Take care and see you next time!
And happy coding as always π₯οΈ