Skip to content

Handler JavaScript

Valentin Chatelain edited this page May 18, 2017 · 2 revisions

Use case

className: GoM.Core.FSAnalyzer.JsProjectHandler

This class inherits from BaseProjectFolderHandler, its goal is to analyze a folder containing a Javascript project and create a new Project with the project's dependencies.

A Javascript package stores its dependencies in a packages.json file, it's a regular json and the dependencies are defined in two properties:

  • dependencies: Packages required for the application to run
  • devDependencies: Packages required for application development

Methods

Sniff: This method analyze the root folder given in the constructor and determine the project's type, the Sniff method can call another Handler to dispatch the work.

Read: The Read method parses dependencies of the project and return a new Project object containing the discovered dependencies.