{"id":1342,"date":"2022-03-23T08:15:07","date_gmt":"2022-03-23T08:15:07","guid":{"rendered":"https:\/\/ethosspace.com\/programmers\/?p=1342"},"modified":"2022-03-23T08:50:21","modified_gmt":"2022-03-23T08:50:21","slug":"use-of-the-package-json-file","status":"publish","type":"post","link":"https:\/\/ethosspace.com\/programmers\/use-of-the-package-json-file\/","title":{"rendered":"Use of the package.json file?"},"content":{"rendered":"\n<p>Package.json&nbsp;is&nbsp;a&nbsp;file&nbsp;found&nbsp;in&nbsp;all&nbsp;<a href=\"https:\/\/ethosspace.com\/programmers\/what-is-npm-node-js-and-how-to-install-it-on-windows\/\" title=\"What is NPM, Node JS, and how to install it on Windows?\">npm&nbsp;<\/a>packages&nbsp;and&nbsp;is&nbsp;normally&nbsp;found&nbsp;in&nbsp;the&nbsp;project&nbsp;root.<\/p>\n\n\n\n<p>It contains various metadata about the project.<\/p>\n\n\n\n<p>This file provides information to npm so that it can identify the project and handle its dependencies.<\/p>\n\n\n\n<p>&nbsp;It&nbsp;can&nbsp;also&nbsp;contain&nbsp;other&nbsp;metadata,&nbsp;such&nbsp;as&nbsp;a&nbsp;project&nbsp;description,&nbsp;the&nbsp;project&#8217;s&nbsp;version.<\/p>\n\n\n\n<p>A Node.js project&#8217;s package.json file is usually found in the root directory.<\/p>\n\n\n\n<p>This example of package.json file used for writing code using cypress<\/p>\n\n\n\n<p>{&#8220;devDependencies&#8221;: {&#8220;cypress&#8221;: &#8220;9.5.2&#8221;}}<\/p>\n\n\n\n<p><strong>What are devDependencies in the package.json file?<\/strong><\/p>\n\n\n\n<p>Dependencies are specified with a simple hash of package name to version range. The version range is a string that has one or more space-separated descriptions. Dependencies can also be identified with a tarball or gitUrl.<\/p>\n\n\n\n<p>devDependencies: Packages that are only needed for local development and testing. <\/p>\n\n\n\n<p><strong>What is tarball?<\/strong><\/p>\n\n\n\n<p>The tarball is\u00a0<strong>a compressed file format<\/strong>. You need to unpack it before running the npm command.<\/p>\n\n\n\n<p><strong>What is <code>\"dependencies\"<\/code> in package.json file?<\/strong><\/p>\n\n\n\n<p><code>\"dependencies\"<\/code>: Packages required by your application in production.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Package.json&nbsp;is&nbsp;a&nbsp;file&nbsp;found&nbsp;in&nbsp;all&nbsp;npm&nbsp;packages&nbsp;and&nbsp;is&nbsp;normally&nbsp;found&nbsp;in&nbsp;the&nbsp;project&nbsp;root. It contains various metadata about the project. This file provides information to npm so that it can identify the project and handle its dependencies. &nbsp;It&nbsp;can&nbsp;also&nbsp;contain&nbsp;other&nbsp;metadata,&nbsp;such&nbsp;as&nbsp;a&nbsp;project&nbsp;description,&nbsp;the&nbsp;project&#8217;s&nbsp;version. A Node.js project&#8217;s package.json file is usually found in the root directory. This example of package.json file used for writing code using cypress {&#8220;devDependencies&#8221;: {&#8220;cypress&#8221;: &#8220;9.5.2&#8221;}} What are devDependencies [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[24,21,22,20,26,25],"tags":[],"class_list":["post-1342","post","type-post","status-publish","format-standard","hentry","category-configuration-and-setup","category-cypress","category-node","category-software-automation-testing","category-software-testing","category-visual-studio-code"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"sparkling-featured":false,"sparkling-featured-fullwidth":false,"tab-small":false},"uagb_author_info":{"display_name":"program45_-rt8nb","author_link":"https:\/\/ethosspace.com\/programmers\/author\/program45_-rt8nb\/"},"uagb_comment_info":0,"uagb_excerpt":"Package.json&nbsp;is&nbsp;a&nbsp;file&nbsp;found&nbsp;in&nbsp;all&nbsp;npm&nbsp;packages&nbsp;and&nbsp;is&nbsp;normally&nbsp;found&nbsp;in&nbsp;the&nbsp;project&nbsp;root. It contains various metadata about the project. This file provides information to npm so that it can identify the project and handle its dependencies. &nbsp;It&nbsp;can&nbsp;also&nbsp;contain&nbsp;other&nbsp;metadata,&nbsp;such&nbsp;as&nbsp;a&nbsp;project&nbsp;description,&nbsp;the&nbsp;project&#8217;s&nbsp;version. A Node.js project&#8217;s package.json file is usually found in the root directory. This example of package.json file used for writing code using cypress {&#8220;devDependencies&#8221;: {&#8220;cypress&#8221;: &#8220;9.5.2&#8221;}} What are devDependencies&hellip;","_links":{"self":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/comments?post=1342"}],"version-history":[{"count":3,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1342\/revisions"}],"predecessor-version":[{"id":1348,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1342\/revisions\/1348"}],"wp:attachment":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/media?parent=1342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/categories?post=1342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/tags?post=1342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}