Use package.json variables in npm scripts

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
~ 7 years ago

On windows, variables are used with %:

%npm_package_version%
Elijah Manorinstructor
~ 7 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
~ 7 years ago

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

Elijah Manorinstructor
~ 6 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