npm optional dependencies code example Example: npm add optional dependency npm install -O <dependency> npm install --save-optional <dependency>