title
Yarn Package Manager Crash Course

description
In this video we will look at the Yarn package manager and talk about what it is and then jump in and look at all of the fundamental commands to install, remove, updated packages, etc. SPONSOR: Check out Coding Dojo - http://www.codingdojo.com/l/yt/tr COMMAND GIST: https://gist.github.com/bradtraversy/9bdab9c9a0bf94e2c6952d3f89e9e350 NPM Crash Course: https://www.youtube.com/watch?v=jHDhaSSKmB0&t=1326s 💖 BECOME A PATRON: Show support & get perks! http://www.patreon.com/traversymedia VISIT MY WEBISTE: Check Out My Udemy Courses http://www.traversymedia.com FOLLOW TRAVERSY MEDIA: http://www.facebook.com/traversymedia http://www.twitter.com/traversymedia http://www.instagram.com/traversymedia https://discord.gg/traversymedia

detail
{'title': 'Yarn Package Manager Crash Course', 'heatmap': [{'end': 357.303, 'start': 296.719, 'weight': 0.736}, {'end': 533.354, 'start': 517.669, 'weight': 0.794}, {'end': 1013.635, 'start': 989.289, 'weight': 0.715}, {'end': 1187.516, 'start': 1144.48, 'weight': 0.94}], 'summary': "Provides a comparison of yarn and npm, highlighting yarn's slight speed advantage and discussing package management. it covers yarn commands including 'yarn v' and 'yarn help', npm and yarn package installation, versioning, and management, and usage of various yarn commands such as 'yarn list', 'yarn add', and 'yarn remove'.", 'chapters': [{'end': 301.442, 'segs': [{'end': 56.082, 'src': 'embed', 'start': 26.397, 'weight': 0, 'content': [{'end': 35.02, 'text': 'this course is for anyone that wants to get started with the yarn package manager and check out the commands and maybe compare it a little bit to npm,', 'start': 26.397, 'duration': 8.623}, {'end': 37.001, 'text': "and i'll talk about that in a second.", 'start': 35.02, 'duration': 1.981}, {'end': 38.562, 'text': 'but first, what is yarn?', 'start': 37.001, 'duration': 1.561}, {'end': 44.508, 'text': "Yarn is a JavaScript package manager, so it's used to install JavaScript packages or modules.", 'start': 39.062, 'duration': 5.446}, {'end': 56.082, 'text': "It was created by Facebook, and it's a fast and reliable alternative to NPM, or Node Package Manager, which comes installed with Node.js.", 'start': 44.909, 'duration': 11.173}], 'summary': 'Yarn is a javascript package manager, a fast and reliable alternative to npm.', 'duration': 29.685, 'max_score': 26.397, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk26397.jpg'}, {'end': 134.381, 'src': 'embed', 'start': 105.727, 'weight': 1, 'content': [{'end': 118.734, 'text': 'and Yes, yarn was much faster, more efficient, more secure, and some of those things may still apply, but not to the magnitude as it did with NPM 4..', 'start': 105.727, 'duration': 13.007}, {'end': 123.436, 'text': 'NPM 5 really took some notes from yarn, or just blatantly copied its advantages.', 'start': 118.734, 'duration': 4.702}, {'end': 134.381, 'text': "It's much faster than NPM 4, but with just about all the tests that I've seen, even with NPM version 5, yarn is still a little bit faster.", 'start': 124.356, 'duration': 10.025}], 'summary': 'Yarn is faster and more efficient than npm 4 and 5, with tests showing yarn to be slightly faster than npm 5.', 'duration': 28.654, 'max_score': 105.727, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk105727.jpg'}, {'end': 215.553, 'src': 'embed', 'start': 186.17, 'weight': 2, 'content': [{'end': 188.212, 'text': 'So there are advantages to Yarn,', 'start': 186.17, 'duration': 2.042}, {'end': 197.68, 'text': "but the big reasons why people said use Yarn over NPM they're just not as great as they used to be since the release of NPM 5,", 'start': 188.212, 'duration': 9.468}, {'end': 200.562, 'text': 'I believe back in May of 2017..', 'start': 197.68, 'duration': 2.882}, {'end': 205.246, 'text': 'So if you ask me my opinion, I just think it boils down to pure preference.', 'start': 200.562, 'duration': 4.684}, {'end': 207.527, 'text': 'I personally use NPM.', 'start': 205.746, 'duration': 1.781}, {'end': 213.111, 'text': "I always have, but recently I've been using yarn quite a bit because I do like the syntax.", 'start': 207.527, 'duration': 5.584}, {'end': 215.553, 'text': "But I'm not gonna say that one is better than the other.", 'start': 213.111, 'duration': 2.442}], 'summary': "Yarn's advantages over npm have diminished since npm 5 release in may 2017, making it a matter of preference. the speaker personally uses npm but has been using yarn more due to liking its syntax.", 'duration': 29.383, 'max_score': 186.17, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk186170.jpg'}], 'start': 7.25, 'title': 'Yarn vs npm comparison', 'summary': "Provides an overview of yarn, a javascript package manager, and compares it with npm in terms of speed, efficiency, and package management. it highlights that yarn is slightly faster and discusses the diminishing differences with npm, emphasizing the choice based on personal preference. additionally, it briefly outlines yarn's installation methods on different operating systems.", 'chapters': [{'end': 68.813, 'start': 7.25, 'title': 'Yarn package manager overview', 'summary': 'Introduces yarn, a javascript package manager created by facebook, as a fast and reliable alternative to npm, with over 90% of coding dojo grads landing jobs within 3 months of graduating and often making over $70k per year.', 'duration': 61.563, 'highlights': ['Coding Dojo grads have over 90% job placement rate within 3 months of graduating, often making over $70k per year', 'Yarn is a JavaScript package manager created by Facebook as a fast and reliable alternative to NPM, the most commonly used package manager for JavaScript', 'NPM crash course is recommended for those not familiar with NPM']}, {'end': 185.41, 'start': 69.453, 'title': 'Yarn vs npm: speed and efficiency', 'summary': 'Compares yarn and npm, highlighting that yarn used to be faster and more efficient than npm 4, but with npm 5, the difference in speed is much closer, with yarn still being slightly faster in most tests, and npm5 also added a standardized lock file for cross package compatibility.', 'duration': 115.957, 'highlights': ['YARN used to be faster and more efficient than NPM 4, but with NPM 5, the difference in speed is much closer, with YARN still being slightly faster in most tests.', 'NPM5 also added a standardized lock file for cross package compatibility.', "NPM5 removed the need to add the dash dash save to save packages to the package.json file, similar to YARN's functionality."]}, {'end': 301.442, 'start': 186.17, 'title': 'Yarn vs npm: package manager comparison', 'summary': 'Discusses the advantages of yarn over npm, but highlights that the differences have diminished since the release of npm 5 in may 2017. it emphasizes that the choice between yarn and npm boils down to personal preference, with npm being more common and yarn being slightly faster. the installation methods for yarn on different operating systems are briefly outlined.', 'duration': 115.272, 'highlights': ['The differences between Yarn and NPM have diminished since the release of NPM 5 in May 2017, making the choice between the two package managers a matter of personal preference. NPM is more common, while Yarn offers a slight speed advantage.', 'Yarn can be installed on Mac using Homebrew or Mac ports, on Windows using an installer or Chocolaty package manager, and on Linux using the standard package manager for the distribution.', "Yarn's installation with NPM is not recommended, and Yarn's installation page does not include instructions for installing it with NPM."]}], 'duration': 294.192, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk7250.jpg', 'highlights': ['Yarn is a JavaScript package manager created by Facebook as a fast and reliable alternative to NPM', 'YARN used to be faster and more efficient than NPM 4, but with NPM 5, the difference in speed is much closer, with YARN still being slightly faster in most tests', 'The differences between Yarn and NPM have diminished since the release of NPM 5 in May 2017, making the choice between the two package managers a matter of personal preference']}, {'end': 489.936, 'segs': [{'end': 425.67, 'src': 'embed', 'start': 301.442, 'weight': 0, 'content': [{'end': 310.048, 'text': "let's just call it yarn test, and i'm going to open that up with vs code and i'm going to use that as my text editor,", 'start': 301.442, 'duration': 8.606}, {'end': 314.311, 'text': 'as well as the integrated terminal which you can open with control back tick.', 'start': 310.048, 'duration': 4.263}, {'end': 316.652, 'text': 'Okay so, from here.', 'start': 315.291, 'duration': 1.361}, {'end': 320.795, 'text': "We're going to start to run our commands, And I don't know if I mentioned this,", 'start': 316.892, 'duration': 3.903}, {'end': 325.578, 'text': 'but all the commands will be in a gist file in the description of this video.', 'start': 320.795, 'duration': 4.783}, {'end': 332.923, 'text': "okay?. So first thing we're going to do is we're going to run yarn V and that's going to give us the current version.", 'start': 325.578, 'duration': 7.345}, {'end': 336.065, 'text': 'you can see, I have version 1.3.2 installed.', 'start': 332.923, 'duration': 3.142}, {'end': 338.907, 'text': "yours may be later, depending on when you're watching this.", 'start': 336.065, 'duration': 2.842}, {'end': 348.177, 'text': 'and OK, we also have the yarn help command, which is going to give us all the different commands that that are available to us.', 'start': 338.907, 'duration': 9.27}, {'end': 357.303, 'text': "Now we're going to be going over just about every command except for ones that have to do with publishing your own packages on in the NPM repository.", 'start': 348.617, 'duration': 8.686}, {'end': 360.746, 'text': "That's a little beyond the scope of this of this video.", 'start': 358.104, 'duration': 2.642}, {'end': 362.487, 'text': "We're not going to talk about those.", 'start': 360.786, 'duration': 1.701}, {'end': 368.935, 'text': "um, next thing we're going to look at is yarn init and you'll notice that a lot of these are similar to npm.", 'start': 363.307, 'duration': 5.628}, {'end': 371.438, 'text': 'so this works just like npm init.', 'start': 368.935, 'duration': 2.503}, {'end': 374.702, 'text': "it's going to ask us some questions.", 'start': 371.438, 'duration': 3.264}, {'end': 378.067, 'text': 'so our package name yarn test version.', 'start': 374.702, 'duration': 3.365}, {'end': 379.328, 'text': "that's good description.", 'start': 378.067, 'duration': 1.261}, {'end': 385.494, 'text': "We'll just say test app and entry point index.js by default.", 'start': 380.349, 'duration': 5.145}, {'end': 393.52, 'text': "Repository, you can put your name if you want for the author and the license and if it's private.", 'start': 386.054, 'duration': 7.466}, {'end': 400.986, 'text': "And then you'll see that it created a package.json file which looks very similar to what would be created with npm.", 'start': 394.481, 'duration': 6.505}, {'end': 406.61, 'text': "Alright, and then we can also add, what I'm going to do is just delete this file.", 'start': 402.347, 'duration': 4.263}, {'end': 410.272, 'text': 'We can also add the dash y flag.', 'start': 407.731, 'duration': 2.541}, {'end': 418.458, 'text': "So if we say yarn init dash y, that'll just accept all the defaults and quickly create the package.json file.", 'start': 410.372, 'duration': 8.086}, {'end': 425.67, 'text': "Okay, so what if we want to set a default? Let's say we want to change the license to ISC.", 'start': 420.447, 'duration': 5.223}], 'summary': 'Tutorial on using yarn for package management, including commands and file creation.', 'duration': 124.228, 'max_score': 301.442, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk301442.jpg'}, {'end': 489.936, 'src': 'embed', 'start': 458.812, 'weight': 6, 'content': [{'end': 469.695, 'text': "we can say yarn config get and let's say we want to look at init license and it shows us that it's ISC.", 'start': 458.812, 'duration': 10.883}, {'end': 475.417, 'text': "now let's say we want to remove it and put it back to the default, which was, I believe, MIT.", 'start': 469.695, 'duration': 5.722}, {'end': 485.253, 'text': 'then we could do yarn config remove init-license.', 'start': 475.417, 'duration': 9.836}, {'end': 489.936, 'text': "Oh, I'm sorry, it's delete, not remove.", 'start': 488.215, 'duration': 1.721}], 'summary': 'Yarn config shows init license as isc, reset to default mit using yarn config delete', 'duration': 31.124, 'max_score': 458.812, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk458812.jpg'}], 'start': 301.442, 'title': 'Yarn commands', 'summary': "Discusses setting up yarn test, using vs code as a text editor, running commands like 'yarn v' and 'yarn help', and introduces various yarn commands including yarn init and yarn config.", 'chapters': [{'end': 348.177, 'start': 301.442, 'title': 'Yarn test and command usage', 'summary': "Discusses setting up yarn test, using vs code as a text editor, and running commands like 'yarn v' to check the current version and 'yarn help' to see all available commands.", 'duration': 46.735, 'highlights': ['Using VS code as a text editor and integrated terminal The speaker mentions using VS code as a text editor and opening an integrated terminal with control back tick.', "Running commands like 'yarn v' and 'yarn help' The chapter explains running 'yarn v' to check the current version (1.3.2 in this case) and 'yarn help' to see all available commands.", 'Availability of command details in a gist file The speaker mentions that all the commands will be available in a gist file in the description of the video.']}, {'end': 489.936, 'start': 348.617, 'title': 'Yarn commands overview', 'summary': 'Introduces various yarn commands including yarn init and yarn config, showcasing how to initialize a package.json file, set defaults, and check config values.', 'duration': 141.319, 'highlights': ['The chapter introduces various yarn commands including yarn init and yarn config. The chapter covers a range of yarn commands, providing an overview of their functionality.', 'Demonstrates how to initialize a package.json file using yarn init. The transcript explains the process of initializing a package.json file using yarn init, showcasing the similarities to npm init.', 'Illustrates using the dash y flag to quickly create the package.json file with default settings. The transcript highlights the use of the dash y flag with yarn init to swiftly create the package.json file with default settings.', 'Shows how to set a default value using yarn config set. The transcript demonstrates the use of yarn config set to establish a default value for a specific configuration setting.', 'Explains how to check config values using yarn config get. The transcript explains the procedure for checking configuration values using yarn config get.', 'Illustrates removing a configuration value using yarn config delete. The transcript illustrates the process of removing a specific configuration value using yarn config delete.']}], 'duration': 188.494, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk301442.jpg', 'highlights': ["Running 'yarn v' to check the current version (1.3.2 in this case) and 'yarn help' to see all available commands.", 'Using VS code as a text editor and opening an integrated terminal with control back tick.', 'The chapter introduces various yarn commands including yarn init and yarn config.', 'Demonstrates how to initialize a package.json file using yarn init.', 'Illustrates using the dash y flag to quickly create the package.json file with default settings.', 'Shows how to set a default value using yarn config set.', 'Explains how to check config values using yarn config get.', 'Illustrates removing a configuration value using yarn config delete.', 'All the commands will be available in a gist file in the description of the video.']}, {'end': 753.922, 'segs': [{'end': 646.714, 'src': 'heatmap', 'start': 517.669, 'weight': 0, 'content': [{'end': 523.154, 'text': "With yarn, we're going to say yarn add lodash.", 'start': 517.669, 'duration': 5.485}, {'end': 527.137, 'text': "And you can see it's very, very quick.", 'start': 525.656, 'duration': 1.481}, {'end': 528.519, 'text': 'That happened in 0.71 seconds.', 'start': 527.197, 'duration': 1.322}, {'end': 533.354, 'text': "All right, let's install another one.", 'start': 531.613, 'duration': 1.741}, {'end': 539.438, 'text': "We'll install the moment package, which has to do with formatting dates and times.", 'start': 533.394, 'duration': 6.044}, {'end': 542.78, 'text': "So we'll say yarn add moment.", 'start': 539.598, 'duration': 3.182}, {'end': 545.581, 'text': "And that'll install it.", 'start': 544.521, 'duration': 1.06}, {'end': 548.203, 'text': 'And obviously it gets set to dependencies.', 'start': 545.642, 'duration': 2.561}, {'end': 551.125, 'text': "There's no need to do dash save or anything like that.", 'start': 548.643, 'duration': 2.482}, {'end': 556.391, 'text': 'OK, we can also install stuff from our package dot Jason.', 'start': 552.148, 'duration': 4.243}, {'end': 564.377, 'text': "So if I were to go in here and let's go ahead and put in, let's say we want to install Gulp and we want to install the latest version,", 'start': 556.431, 'duration': 7.946}, {'end': 566.138, 'text': 'we could just put an asterisk like that.', 'start': 564.377, 'duration': 1.761}, {'end': 569.501, 'text': 'So right now, if I save this, Gulp is not installed.', 'start': 566.659, 'duration': 2.842}, {'end': 576.646, 'text': 'If we want to install it or anything that we put manually in here, then we would run yarn install.', 'start': 570.001, 'duration': 6.645}, {'end': 584.49, 'text': "and that's going to install gulp and any dependencies that it has.", 'start': 579.247, 'duration': 5.243}, {'end': 586.291, 'text': 'okay, now to remove a package.', 'start': 584.49, 'duration': 1.801}, {'end': 595.967, 'text': "we can say yarn remove and let's remove low dash, So it'll remove it and it will remove it from our dependencies.", 'start': 586.291, 'duration': 9.676}, {'end': 605.393, 'text': "And let's say we want to install a certain version of a package, like Lodash right now is 4.17.4.", 'start': 596.428, 'duration': 8.965}, {'end': 609.496, 'text': "Let's say we want to install 4.17.3 for some reason.", 'start': 605.394, 'duration': 4.102}, {'end': 615.841, 'text': 'So we can simply say yarn add Lodash, and we can use the at symbol and say 4.17.3.', 'start': 609.616, 'duration': 6.225}, {'end': 618.002, 'text': 'All right, so now if we install that..', 'start': 615.841, 'duration': 2.161}, {'end': 627.947, 'text': 'you can see that that version is installed.', 'start': 623.866, 'duration': 4.081}, {'end': 629.928, 'text': 'now in the npm crash course.', 'start': 627.947, 'duration': 1.981}, {'end': 636.57, 'text': 'i go over this stuff a little more the package.json file and the versioning, how that works.', 'start': 629.928, 'duration': 6.642}, {'end': 643.113, 'text': "for instance the carrot symbol, which means that it's not going to go past the major version here.", 'start': 636.57, 'duration': 6.543}, {'end': 646.714, 'text': "it'll just update the sub versions and we go over all that.", 'start': 643.113, 'duration': 3.601}], 'summary': 'Using yarn, installed lodash in 0.71s, moment package, gulp from package.json, removed lodash, and installed specific version.', 'duration': 156.758, 'max_score': 517.669, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk517669.jpg'}], 'start': 489.956, 'title': 'Package management with npm, yarn, and versioning', 'summary': "Covers installing packages with npm and yarn, showcasing npm and yarn's quick installation time of 0.71 seconds, demonstrating the installation of lodash and moment packages, explaining yarn package management basics, including installing, removing, and specifying versions of packages, and discussing package versioning using symbols like the carrot symbol, finding outdated modules, and upgrading them using commands like yarn outdated and yarn upgrade, as well as exploring global modules.", 'chapters': [{'end': 556.391, 'start': 489.956, 'title': 'Installing packages with npm and yarn', 'summary': 'Explains how to install packages using npm and yarn, showcasing the quick installation time of 0.71 seconds and demonstrating the installation of lodash and moment packages.', 'duration': 66.435, 'highlights': ['Yarn installation of packages is very quick, happening in 0.71 seconds.', 'The chapter demonstrates the installation of lodash and moment packages using npm and yarn.', "Yarn's quick installation time of 0.71 seconds is showcased when installing packages.", 'The installation of lodash and moment packages using npm and yarn is demonstrated.']}, {'end': 615.841, 'start': 556.431, 'title': 'Yarn package management basics', 'summary': 'Covers the basics of using yarn package manager, including installing, removing, and specifying versions of packages, with examples and commands provided.', 'duration': 59.41, 'highlights': ['Yarn install command installs Gulp and its dependencies, allowing for quick and easy setup.', "Yarn remove command removes a specific package from the dependencies, such as 'lodash', streamlining the package management process.", 'Yarn add command allows for specifying the version of a package to be installed, providing flexibility and control over package versions.']}, {'end': 753.922, 'start': 615.841, 'title': 'Package versioning and upgrading', 'summary': 'Discusses package versioning, using symbols like the carrot symbol to indicate version constraints, and demonstrates how to find outdated modules and upgrade them using commands like yarn outdated and yarn upgrade, as well as exploring global modules.', 'duration': 138.081, 'highlights': ['The chapter covers package versioning and demonstrates using symbols like the carrot symbol to indicate version constraints.', 'It explains how to find outdated modules using commands like yarn outdated, and how to upgrade modules using commands like yarn upgrade.', "The transcript also briefly mentions global modules but doesn't provide detailed information about them."]}], 'duration': 263.966, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk489956.jpg', 'highlights': ['Yarn installation of packages is very quick, happening in 0.71 seconds.', "Yarn's quick installation time of 0.71 seconds is showcased when installing packages.", 'The chapter demonstrates the installation of lodash and moment packages using npm and yarn.', 'Yarn install command installs Gulp and its dependencies, allowing for quick and easy setup.', "Yarn remove command removes a specific package from the dependencies, such as 'lodash', streamlining the package management process.", 'The chapter covers package versioning and demonstrates using symbols like the carrot symbol to indicate version constraints.']}, {'end': 1361.759, 'segs': [{'end': 784.178, 'src': 'embed', 'start': 753.922, 'weight': 0, 'content': [{'end': 760.567, 'text': "so if you have any experience with npm, which i'm guessing a lot of you, do you know that if you want to install something globally,", 'start': 753.922, 'duration': 6.645}, {'end': 762.268, 'text': 'you use the dash g?', 'start': 760.567, 'duration': 1.701}, {'end': 769.232, 'text': "so you would do whoops, you would do npm, install dash g and then let's say nodemon,", 'start': 762.268, 'duration': 6.964}, {'end': 773.975, 'text': 'which is a module to continuously watch your node.js applications.', 'start': 769.232, 'duration': 4.743}, {'end': 778.656, 'text': 'So with yarn, what we do is we use global.', 'start': 774.575, 'duration': 4.081}, {'end': 784.178, 'text': 'So yarn global, global add node mon.', 'start': 778.736, 'duration': 5.442}], 'summary': "Yarn uses 'global add' to install packages globally, e.g. 'yarn global add nodemon'.", 'duration': 30.256, 'max_score': 753.922, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk753922.jpg'}, {'end': 903.855, 'src': 'embed', 'start': 879.295, 'weight': 1, 'content': [{'end': 889.026, 'text': 'okay. and now, if we look back in that folder, you can see that the nodemon cmd file is now gone.', 'start': 879.295, 'duration': 9.731}, {'end': 893.731, 'text': 'now, if you want to list out your packages, you could say yarn list.', 'start': 889.026, 'duration': 4.705}, {'end': 900.653, 'text': "OK, now it's going to give you all your dependencies and the dependencies of the dependencies.", 'start': 895.43, 'duration': 5.223}, {'end': 903.855, 'text': 'For instance, you can see all the stuff that we have here.', 'start': 900.713, 'duration': 3.142}], 'summary': "Using 'yarn list' command to display dependencies and their dependencies.", 'duration': 24.56, 'max_score': 879.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk879295.jpg'}, {'end': 1013.635, 'src': 'heatmap', 'start': 989.289, 'weight': 0.715, 'content': [{'end': 1000.518, 'text': "You can also do dash dash dev, okay? But we're going to do uppercase D, and there we go.", 'start': 989.289, 'duration': 11.229}, {'end': 1003.56, 'text': 'So now gulp is added as a development dependency.', 'start': 1000.558, 'duration': 3.002}, {'end': 1013.635, 'text': "Now if we want to remove that, even though it's a dev dependency, all we have to do is say yarn remove gulp.", 'start': 1005.683, 'duration': 7.952}], 'summary': 'Adding gulp as a development dependency and removing it using yarn.', 'duration': 24.346, 'max_score': 989.289, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk989289.jpg'}, {'end': 1090.277, 'src': 'embed', 'start': 1033.694, 'weight': 2, 'content': [{'end': 1039.858, 'text': 'One thing you may have noticed is when we ran yarn and knit, it created this yarn dot lock file.', 'start': 1033.694, 'duration': 6.164}, {'end': 1048.204, 'text': 'And basically, this is used to have consistent installs across machines.', 'start': 1040.758, 'duration': 7.446}, {'end': 1054.688, 'text': 'So it holds exactly which versions of the dependencies that were installed along with the repo link.', 'start': 1048.304, 'duration': 6.384}, {'end': 1059.992, 'text': "And you yourself don't have to worry about this 99% of the time.", 'start': 1055.289, 'duration': 4.703}, {'end': 1062.294, 'text': "It's completely managed by YARN.", 'start': 1060.333, 'duration': 1.961}, {'end': 1072.941, 'text': "There is a command that verifies that the versions of the dependencies in your package dot JSON file match that the lock file and that's yarn check.", 'start': 1063.095, 'duration': 9.846}, {'end': 1081.753, 'text': 'So if we were to say yarn check, And it just tells us success that the folders are in sync.', 'start': 1073.282, 'duration': 8.471}, {'end': 1084.314, 'text': 'So if you ever want to check that, then you could do that.', 'start': 1081.773, 'duration': 2.541}, {'end': 1087.476, 'text': 'Another thing, another command we have is yarn import.', 'start': 1084.434, 'duration': 3.042}, {'end': 1090.277, 'text': 'So for some reason, this gets deleted.', 'start': 1087.596, 'duration': 2.681}], 'summary': 'Yarn creates yarn.lock for consistent installs, verified by yarn check.', 'duration': 56.583, 'max_score': 1033.694, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk1033694.jpg'}, {'end': 1187.516, 'src': 'heatmap', 'start': 1121.617, 'weight': 4, 'content': [{'end': 1135.434, 'text': "so i'm going to say yarn, add nodemon as a dev, oops as a dev dependency, And then I'm going to add a script.", 'start': 1121.617, 'duration': 13.817}, {'end': 1139.277, 'text': "So I'm going to go right here above our dependencies and put in scripts.", 'start': 1135.454, 'duration': 3.823}, {'end': 1144.4, 'text': 'Okay, set that to an object.', 'start': 1139.297, 'duration': 5.103}, {'end': 1145.741, 'text': 'Make sure you put a comma there.', 'start': 1144.48, 'duration': 1.261}, {'end': 1148.243, 'text': "And let's say we want a script called dev.", 'start': 1146.161, 'duration': 2.082}, {'end': 1154.287, 'text': 'And we want that to run nodemon and watch the index.js file.', 'start': 1148.863, 'duration': 5.424}, {'end': 1158.91, 'text': "So we'll save that and then let's create an index.js file.", 'start': 1154.887, 'duration': 4.023}, {'end': 1168.643, 'text': "And all I'm going to do here is console.log hello world and save.", 'start': 1160.854, 'duration': 7.789}, {'end': 1174.53, 'text': 'All right, so if we want to run this, what we can do is say yarn run dev.', 'start': 1169.083, 'duration': 5.447}, {'end': 1177.285, 'text': 'All right.', 'start': 1177.045, 'duration': 0.24}, {'end': 1180.288, 'text': "And what it'll do is just constantly watch this file.", 'start': 1177.365, 'duration': 2.923}, {'end': 1185.233, 'text': "If I were to change this to hello there and save, it's going to watch it.", 'start': 1180.348, 'duration': 4.885}, {'end': 1187.516, 'text': "It's going to reload and it's going to console log.", 'start': 1185.273, 'duration': 2.243}], 'summary': 'Setting up yarn with nodemon for file watching and reloading', 'duration': 32.67, 'max_score': 1121.617, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk1121617.jpg'}], 'start': 753.922, 'title': 'Yarn package management', 'summary': "Covers yarn global package installation and removal, npm vs. yarn differences, yarn package management basics including commands like 'yarn list', 'yarn add', and 'yarn remove', and usage of various yarn commands such as yarn.lock, yarn check, yarn import, and setting up scripts in package.json.", 'chapters': [{'end': 876.928, 'start': 753.922, 'title': 'Yarn global installation and removal', 'summary': 'Highlights the differences between npm and yarn for global package installation and removal, emphasizing the specific commands and order required, and provides an example of accessing global packages using yarn global bin command.', 'duration': 123.006, 'highlights': ["Yarn uses 'global' for global package installation, unlike npm which uses '-g', and the order of the command is important, as demonstrated by the example of installing nodemon.", "The command 'yarn global bin' can be used to find out where global packages are installed, as shown with the example of locating nodemon installation on Windows.", "To remove global packages with yarn, 'global' needs to be included before the package name, emphasizing the importance of the order of commands."]}, {'end': 1032.635, 'start': 879.295, 'title': 'Yarn package management basics', 'summary': "Introduces yarn package management, showcasing commands like 'yarn list' to display all dependencies, 'yarn add' to install a dev dependency like gulp, and 'yarn remove' to uninstall packages.", 'duration': 153.34, 'highlights': ["The 'yarn list' command displays all dependencies and their sub-dependencies, providing a comprehensive overview of the project's packages.", "Using 'yarn add' with the flag '-D' or '--dev' allows for the installation of packages as development dependencies, such as adding gulp as a dev dependency.", "The 'yarn remove' command effectively uninstalls packages, even when they are dev dependencies, streamlining the package management process."]}, {'end': 1361.759, 'start': 1033.694, 'title': 'Yarn commands and package management', 'summary': 'Discusses the usage of yarn commands, such as yarn.lock file, yarn check for verifying dependencies, yarn import for generating a new yarn lock file, setting up scripts in package.json, and uncommon yarn commands like licenses, pack, and cache management.', 'duration': 328.065, 'highlights': ['Yarn.lock file ensures consistent installs across machines by holding versions of dependencies and repo link. The yarn.lock file ensures consistent installs across machines by holding exactly which versions of the dependencies were installed along with the repo link.', 'Yarn check verifies that the versions of dependencies in package.json match the lock file. The yarn check command verifies that the versions of the dependencies in the package.json file match the lock file, ensuring synchronization.', 'Yarn import generates a new yarn lock file from the existing node modules folder. The yarn import command generates a new yarn lock file from the existing node modules folder, providing a solution if the lock file gets deleted.', "Setting up scripts in package.json allows running custom scripts like dev using nodemon to watch files. Setting up scripts in package.json allows running custom scripts like 'dev' using nodemon to watch specific files, providing flexibility in script execution.", 'Yarn licenses command checks and lists the licenses of packages. The yarn licenses command checks and lists the licenses of packages, providing insight into the licenses of the installed dependencies.', 'Yarn pack creates a tarball of all packages, and yarn cache manages caching with options to list, check, and clear cache. Yarn pack creates a tarball of all packages, while yarn cache manages caching by listing, checking for specific modules, and clearing the cache.']}], 'duration': 607.837, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/g9_6KmiBISk/pics/g9_6KmiBISk753922.jpg', 'highlights': ["Yarn uses 'global' for global package installation, unlike npm which uses '-g', and the order of the command is important, as demonstrated by the example of installing nodemon.", "The 'yarn list' command displays all dependencies and their sub-dependencies, providing a comprehensive overview of the project's packages.", 'Yarn.lock file ensures consistent installs across machines by holding versions of dependencies and repo link.', 'Yarn check verifies that the versions of dependencies in package.json match the lock file.', "Setting up scripts in package.json allows running custom scripts like 'dev' using nodemon to watch specific files, providing flexibility in script execution."]}], 'highlights': ['Yarn is a JavaScript package manager created by Facebook as a fast and reliable alternative to NPM', 'YARN used to be faster and more efficient than NPM 4, but with NPM 5, the difference in speed is much closer, with YARN still being slightly faster in most tests', 'The differences between Yarn and NPM have diminished since the release of NPM 5 in May 2017, making the choice between the two package managers a matter of personal preference', "Running 'yarn v' to check the current version (1.3.2 in this case) and 'yarn help' to see all available commands", 'Yarn installation of packages is very quick, happening in 0.71 seconds', "Yarn uses 'global' for global package installation, unlike npm which uses '-g', and the order of the command is important, as demonstrated by the example of installing nodemon", "The 'yarn list' command displays all dependencies and their sub-dependencies, providing a comprehensive overview of the project's packages", 'Yarn.lock file ensures consistent installs across machines by holding versions of dependencies and repo link', 'Yarn check verifies that the versions of dependencies in package.json match the lock file', "Setting up scripts in package.json allows running custom scripts like 'dev' using nodemon to watch specific files, providing flexibility in script execution"]}