Kyle  M. Farish

Kyle M. Farish

1587176780

10 Cool Things You Should Know about NPM

1. What is NPM

  • npm stands for Node Package Manager and most of JavaScript program is registered to npm as a package
  • npm has more than 700K package registered; the world largest IT ecosystem
  • yarn is alternative of npm ; created by Facebook

2. package.json

  • The same package can have different functionalities depending on its version; package.json file records all the installed package
  • The command to create packge.json
$ npm init

This is image title

package name : The name of package; name property of package.json

version : npm version is strictly managed (we will go through deeply later)

entry point : entry point for JavaScript executable file. Often the last module.exports file

git repository : repository property of package.json

keywords : enable user to find the package easily in npm official site (https://npmjs.com) keywords property of package.json

3. License

  • ISC, MIT, BSD license : free to use when you acknowledge module and license
  • Apache : free to use but has patent right restriction
  • GPL : need to make source code public and distribute until GPL license when deploying

4. scripts in package.json

  • script property specifies npm command line i.e., npm run [SCRIPT COMMAND] in console
  • Often time, save node [FILE NAME] under start command and execute npm start like React.js, Vue.js

##. 5 — save option

  • --save option for npm install command is often used for tutorials
  • --save option adds package name to dependencies but it’s default from npm@5 ; Therefore, no need to specify --save option for npm install command

6. — save-dev option

  • --save-dev option for packages only for development i.e., nodemon provides hot loading whenever the source code is changed and it’s often used only for development
  • --save-dev can be abbreviated to -D
// console
npm install --save-dev nodemand

// package.json
{

 ...
 
 "devDependencies": {
 
 "nodemon": "^1.17.3"
 }
}

7. package version

  • node package version is always consists of 3 numbers because it follows SemVer (Semantic Versioning) rule
1.0.7

First number (1) :

  • major version
  • 0 stands for development version; official version starting from 1
  • major version is incremented only when the lower version cannot be compatible i.e., upgrade from 1.5.0 to 2.0.0 means that it’s very probable to cause errors for updating to 2.0.0 from 1.5.0

Second number (0) :

  • minor version
  • lower version is compatible and often functionality update i.e., no problem upgrade from 1.5.0 to 1.6.0 in terms of compatibility

Third number (7) :

  • patch version
  • fix the existing error i.e, upgrade from 1.5.0 to 1.5.1 should not cause any errors

8. ^ , < , ~ symbol for package version

^ :

  • install / update to minor version
  • i.e., npm i express@^1.1.1 installs a version from 1.1.1 ~ 2.0.0 (excluding 2.0.0 because the first number has changed and it’s major (version) change)

~ :

  • install / update to patch version
  • i.e., npm i express@~1.1.1 installs a version from 1.1.1 ~ 1.2.0

^ is often useful than ~ because minor version update is compatible to the lower version and has the most updated functionalities

@latest : used to install the most updated (latest) version of packages (can be expressed as npm i express@latest or npm i express@x

9. npm outdated command

  • can find available updated package using npm outdated

This is image title

  • needs an update if Current & Wanted is different
  • can update by executing npm update [PACKAGE NAME]
  • running npm update updates ALL packages to the version specified in Wanted

10. useful resource

Compare packages

This is image title

Check the download trend of package

This is image title

Thank you for reading!

#nodejs #javascript #web development #programming

What is GEEK

Buddha Community

10 Cool Things You Should Know about NPM
Modesto  Bailey

Modesto Bailey

1596739800

NPM Install and NPM CI: In What Aspect They Differ

Nodejs web development has achieved such a huge acclamation all over the world just because of its large ecosystem of libraries known as NPM modules. It is the largest software package library in the world, with over 500,000+ packages. Each time a Command Line Interface (CLI) for npm comes as an add-on with Nodejs installation which allows developers to connect with packages locally on their machine.

The idea of npm modules had come with some technical advancement in package management like reusable components, with easy installation via an online repository, with version and dependency management.

In general,NPM is a default package manager for every Nodejs development project. Npm eases the installing and updating dependencies processes. A dependency list on npmjs even provides you with the installation command, so that you can simply copy and paste in the terminal to initiate installation procedures.

All npm users have an advantage of a new install command called “npm ci(i.e. npm continuous integration)”. These commands provide enormous improvements to both the performance and reliability of default builds for continuous integration processes. In turn, it enables a consistent and fast experience for developers using continuous integration in their workflow.

In npm install, it reads the package.json to generate a list of dependencies and uses package-lock.json to know the exact version of these dependencies to install. If the dependency is found in package-lock.jso, it will be added by npm install.

Whereas here, the npm ci (continuous integration) installs dependencies from package-lock.json directly and use up package.json just to verify that there are no mismatched versions exists. If any dependencies mismatching versions, it will show an error.

#npm-install #npm-ci #npm #node-package-manager

Mike doctor

Mike doctor

1624575600

7 Things to Know BEFORE Buying a Rental Property

In this video, I’m going over 7 things you NEED to know before buying your first rental or investment property in 2021. Watch this video in full to have less stress, make more money, and know how to leverage real estate to your advantage.

I own a real estate brokerage in California and have been in the industry for close to 4 years now. These are my insights on real estate investing.

From investing in multiunits in the right locations, to understanding the tax benefits, to running the numbers to make sure an investment makes sense, there are so many things any new real estate investor should know. If you want to start real estate investing and get your first rental property in 2021, this is the video for you.

There is a lot of opportunity in real estate, and as a real estate investor you need to know what the benefits are (to save on taxes) and how you can maximize the profit of your rental. These are the things I wish I knew before buying my first rental at the age of 25 - it would have saved me a lot of time and money.

I’m super excited for you! There are deals everywhere and as long as you know how to identify these deals, allocate resources correctly, and find the right tenants, you will do well. This is a long term way to build cash flow and generational wealth, for those who do it correctly.

Happy real estate investing! I’m rooting for all of you. Let’s buy some units in 2021! If you’re a hustler, make sure to hit that like button and subscribe for more content like this - I make a ton of content about personal finance, investing, and entrepreneurship.

#7 things to know before buying a rental property #bitcoin #blockchain #buying a rental property #a rental property #things to know before buying a rental property

Trystan  Doyle

Trystan Doyle

1593008507

Up your npm game with these 4 practices

If you don’t know what npm is then you should probably read about it before reading this article. This article is going to touch on recommendations and advanced concepts for those experienced with it. If you’re not, don’t worry, it’s not that complicated. I can recommend reading this article to get you started.

#npm #npm-package #node-package-manager #npm-weekly #up #programming

Rahim Makhani

Rahim Makhani

1623475913

Find the best IoT Developers near you

The Internet of Things (IoT) represents the network of physical objects installed with sensors, software, and other technologies to connect and exchange data with other systems and devices over the network.

IoT has changed the way computers think; it has made computers understand in an innovative and better way. As a result, many business owners are developing IoT-based apps for their businesses to grow and expand.

Do you also want to develop an IoT app for the business? You can hire an IoT developer from Nevina Infotech to develop your app. We are the leading app development company with a team of dedicated developers on whom you can rely.

#internet of things development #internet of things development companies #internet of things software development #internet of things application development #android app development internet of things

Kyle  M. Farish

Kyle M. Farish

1587176780

10 Cool Things You Should Know about NPM

1. What is NPM

  • npm stands for Node Package Manager and most of JavaScript program is registered to npm as a package
  • npm has more than 700K package registered; the world largest IT ecosystem
  • yarn is alternative of npm ; created by Facebook

2. package.json

  • The same package can have different functionalities depending on its version; package.json file records all the installed package
  • The command to create packge.json
$ npm init

This is image title

package name : The name of package; name property of package.json

version : npm version is strictly managed (we will go through deeply later)

entry point : entry point for JavaScript executable file. Often the last module.exports file

git repository : repository property of package.json

keywords : enable user to find the package easily in npm official site (https://npmjs.com) keywords property of package.json

3. License

  • ISC, MIT, BSD license : free to use when you acknowledge module and license
  • Apache : free to use but has patent right restriction
  • GPL : need to make source code public and distribute until GPL license when deploying

4. scripts in package.json

  • script property specifies npm command line i.e., npm run [SCRIPT COMMAND] in console
  • Often time, save node [FILE NAME] under start command and execute npm start like React.js, Vue.js

##. 5 — save option

  • --save option for npm install command is often used for tutorials
  • --save option adds package name to dependencies but it’s default from npm@5 ; Therefore, no need to specify --save option for npm install command

6. — save-dev option

  • --save-dev option for packages only for development i.e., nodemon provides hot loading whenever the source code is changed and it’s often used only for development
  • --save-dev can be abbreviated to -D
// console
npm install --save-dev nodemand

// package.json
{

 ...
 
 "devDependencies": {
 
 "nodemon": "^1.17.3"
 }
}

7. package version

  • node package version is always consists of 3 numbers because it follows SemVer (Semantic Versioning) rule
1.0.7

First number (1) :

  • major version
  • 0 stands for development version; official version starting from 1
  • major version is incremented only when the lower version cannot be compatible i.e., upgrade from 1.5.0 to 2.0.0 means that it’s very probable to cause errors for updating to 2.0.0 from 1.5.0

Second number (0) :

  • minor version
  • lower version is compatible and often functionality update i.e., no problem upgrade from 1.5.0 to 1.6.0 in terms of compatibility

Third number (7) :

  • patch version
  • fix the existing error i.e, upgrade from 1.5.0 to 1.5.1 should not cause any errors

8. ^ , < , ~ symbol for package version

^ :

  • install / update to minor version
  • i.e., npm i express@^1.1.1 installs a version from 1.1.1 ~ 2.0.0 (excluding 2.0.0 because the first number has changed and it’s major (version) change)

~ :

  • install / update to patch version
  • i.e., npm i express@~1.1.1 installs a version from 1.1.1 ~ 1.2.0

^ is often useful than ~ because minor version update is compatible to the lower version and has the most updated functionalities

@latest : used to install the most updated (latest) version of packages (can be expressed as npm i express@latest or npm i express@x

9. npm outdated command

  • can find available updated package using npm outdated

This is image title

  • needs an update if Current & Wanted is different
  • can update by executing npm update [PACKAGE NAME]
  • running npm update updates ALL packages to the version specified in Wanted

10. useful resource

Compare packages

This is image title

Check the download trend of package

This is image title

Thank you for reading!

#nodejs #javascript #web development #programming