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...
Node Module - Folders as Modules

Code is organized in one directories splits between files and a single entry point is provided. There are three ways in which a folder may be passed to require() as an argument. create a package.json...



Share this page:
Follow us:
Task Runner