Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jspm or npm to install packages?

Tags:

npm

jspm

I'm new to jspm, transitioning from npm-only. I have one fundamental question. I have some dependencies in the package.json, and I runned jspm init, which created a nice jspm config.js file. My question is, what it the point of installing these packages from jspm (via jspm install ...)? Why not just install them through npm?

More specifically, in my package.json, what's the difference between putting these packages inside dependencies: {} vs inside jspm.dependencies: {}

like image 245
jeanpaul62 Avatar asked May 09 '16 09:05

jeanpaul62


People also ask

Does npm install package?

In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package. By default, npm install will install all modules listed as dependencies in package.

What is the difference between npm install and npm install?

npm install , or npm i , is used to install dependencies: It will install all the dependencies. If you use ^ or ~ when you specify the version of your dependency, npm may not install the exact version you specified. npm install can update your package-lock.

Whats difference between npm I install and npm I install -- save?

It has a very frequently used command npm install [Package Name] –save. But the fact is there is no difference between npm install [Package Name] and npm install [Package Name] –save in the later version after npm 5.0.

Is npm I the same as npm install?

There is no difference, since "npm i" is an alias for "npm install". They both do the exact same thing (install or update all the dependencies in your package-lock.


1 Answers

Assuming that you are building a webapp jspm is more suitable for managing your frontend dependencies than npm. I think for a webapp npm only makes sense when used together with browserify. One key benefit of jspm is that you can load your dependencies using SystemJS & the ES6 Module Loader Polyfill. This enables you to load the dependencies in the browser using the ES6 module syntax. E.g.:

import 'jquery';

Keep in mind that jspm is ment to be used for your frontend dependencies. For your dependencies used for the build process you should keep using npm.

like image 155
brass monkey Avatar answered Oct 30 '22 09:10

brass monkey