As npm is the package manager for node, I frequently see it used with laravel boilerplate projects, but I can't reason why?
For example, this laravel-5-boilerplate instructs to npm install
within the steps of installing the project..
Other examples too can be found of using npm with laravel..
Can someone please explain to me?
While Laravel does not dictate which JavaScript or CSS pre-processors you use, it does provide a basic starting point using Bootstrap and Vue that will be helpful for many applications. By default, Laravel uses NPM to install both of these frontend packages.
npm is the world's largest Software Registry. The registry contains over 800,000 code packages. Open-source developers use npm to share software. Many organizations also use npm to manage private development.
Laravel: It is a PHP framework that is free and open-source enabling developers to use the pattern of MVC in the development needs. NodeJS: It is a JavaScript Runtime Environment that is used for Cross-Platform development needs.
If you need a full-scale system to handle a massive website that is based on CMS, go with Laravel. If you need a service-based architecture that is compact, go with Node JS. Laravel platform contains the Eloquent ORM, which requires a basic implementation of PHP Active Record.
Nowadays npm
containing general tools for work with various front-end tasks. So, it's very useful to grab some packages from it. In case of laravel, there is two utilities, that it uses:
gulp - streaming building tool for concatenating, minifing your css,js code.
laravel-elixir - is wrapper for gulp, written by Jeffrey Way, who is doing laracasts for us. It's place where you can found out more about this this tool in particular and in common.
If you will use only standart js/css, you can pass this step.
Blockquote
I made that boilerplate. That command is specific to download the dependencies for the Laravel Elixir package (http://laravel.com/docs/5.0/elixir) But has many, many uses outside that.
The Elixir docs explain it very well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With