Sunday, November 28, 2021
Releases NPM Minor Release v7.1.0

NPM Minor Release v7.1.0

With two new features

This release brings two new features:

The first one is a new command: npm set-script – this lets you create a task in the scripts section of the package.json.

npm set-script start "http-server ."

{
  ...
  "scripts": {
    "start": "http-server ."
    ...
  },
  ...
}

Asking people to touch the package.json file, can easily lead to errors.

This new CLI can be useful for instructions, such as workshops or tutorials. Without asking to change the package.json file, an instruction can be like: Now type npm set-script start "nw ." and then npm start

Here is another example:

 npm init -y && npm install --save-dev http-server && npm set-script start "http-server ." && npm start

The second feature regards npm exec (no arguments) – which now triggers an interactive subshell that enables the run of installed binaries (this is similar to how scripts from package.json can access binaries when running npm run).

Update now and give it a try!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest news

2 great tips to get hired faster

If it's time to change job and would like to do it faster, we have two useful tips for...

EpicReact.Dev – Well polished advanced ReactJS Training

There are countless tutorials that cover the basics of ReactJS. A lot of them are very well made, with...

Becoming a Front-end developer in 2021

In the past few years, we've been hearing more and more about learning fatigue for front-end development. And it...

Algorithms are more common in Interviews

The tech interviews for developers have shifted a lot in the past 15-20 years. In the early 2000, a...

More on React Server Components

Will React Server Side components change how we build React Applications?What does this mean for libraries such as NextJS? Recently,...

Top 5 ReactJS Podcasts with fresh content

There are different platforms and different sources of information to get up-to-date content on the ever growing topic of...

Must read

2 great tips to get hired faster

If it's time to change job and would like...

EpicReact.Dev – Well polished advanced ReactJS Training

There are countless tutorials that cover the basics of...

You might also likeRELATED
Recommended to you