Use package.json variables in npm scripts

Elijah Manor
InstructorElijah Manor

Share this video with your friends

Send Tweet

In this lesson we will show that you can leverage values that you already have provided in your package.json file such as the name and version keys. You may want to use these in your npm scripts as you create folders and file names.

Victor
Victor
~ 4 years ago

On windows, variables are used with %:

%npm_package_version%
Elijah Manor
Elijah Manorinstructor
~ 4 years ago

Very true. There are many things that need to be address when you want npm scripts to run cross-environment. I cover several of those concepts in lesson 16. My intent was to start simple and then talk about challenges as they came along.

Alexander Hofstede
Alexander Hofstede
~ 4 years ago

Why are the files also in /public in the end there?

Elijah Manor
Elijah Manorinstructor
~ 3 years ago

Why are the files also in /public in the end there?

Those were left over from before I added the logic to make the folders :) Great question