Why do we need package.json

Why do we need package.json

Most of us are concerned or focused on the place where we write our code, whether it might be styling (css) or logic(ts) or rendering part (html).

Few files which we need understanding are Angular.json, Package.json, Package-lock.json.


In this article, let's understand what exactly Package.json file contains.

  1. Meta data such as project name, version, author name etc.
  2. Dependencies : npm packages that are installed for running the project
  3. Dev Dependencies : As the name indicates, it contains dependencies that are used for development. These are not needed for production
  4. Scripts : It contains commands that can be executed using npm. As soon as the project is created, scripts can be seen as below


SCRIPTS in package.json

?

Creating custom command to START AND BUILD TOGETHER

Custom command named as 'command-start-build'

?

Running the above command in terminal

Running custom command in terminal

Could see the build successful first and then started running application

Successful build after running custom command

Hope you enjoyed the article and find it helpful. Please comment incase of queries


?

要查看或添加评论,请登录

Sougandika L的更多文章

  • Lifecycle Methods in Functional components

    Lifecycle Methods in Functional components

    Lifecycle refers to the series of phases that a React component goes through from its creation, rendering and eventual…

  • Are you excited to know about Event Flow in Javascript ??

    Are you excited to know about Event Flow in Javascript ??

    Order in which event triggered on DOM nodes is called event flow. There are 2 types of events: 1.

  • Angular 18 feature - Zoneless Change Detection

    Angular 18 feature - Zoneless Change Detection

    One of the most significant changes is the introduction of zoneless change detection. Reason : To avoid unnecessary…

  • Difference between Subject and Observable

    Difference between Subject and Observable

    1.Subject can be provider as well as consumer.

  • SIGNAL in Angular

    SIGNAL in Angular

    With Change detection, incase of any change in one of the components, it check for all the components and then render…

    1 条评论
  • Creating Reusable Components in Angular

    Creating Reusable Components in Angular

    Lets start with a basic button Here in the image we could see 3 different buttons with different names, different…

    3 条评论
  • Reactive forms in Angular

    Reactive forms in Angular

    Angular provides 2 ways to work with forms – 1. Template driven forms 2.

  • Angular -Download Data in Excel format

    Angular -Download Data in Excel format

    Hello everyone, One of the most common usecases now a days is printing the data. In this article we will be…

  • Why Array ? Its declaration in Javascript

    Why Array ? Its declaration in Javascript

    Array is a special variable which holds more than one value at a time. It stores the homogenous elements.

  • Scope: What does it exactly mean?

    Scope: What does it exactly mean?

    Hello everyone, This is Sougandika. Do you want to know what is scope? Be with me till the end and I am sure that this…

社区洞察

其他会员也浏览了