Javascript Package - Main (Entry Point)

About

The main entry point in Node.

In a package

In a package, the main property in package.json defines the main script

How to get it at runtime ?

Because module provides a filename property (normally equivalent to __filename), the entry point of the current application can be obtained by checking require.main.filename





Discover More
Javascript Package - Package.json

Package.json is used by npm to store metadata for projects published as package. The package.json files: serves as documentation for what packages your project depends on. allows you to specify...



Share this page:
Follow us:
Task Runner