Skip to content
Advertisement

What is “entry point” in npm init

I have an empty new project, when i run npm init i got a list of questions to answer, for example:

name: (karma)
version: (1.0.0)
description:my project description
entry point: (index.js)

I am really confused about the one that says “entry point”, Should this be my index.html file or my app.js or is it something else?

Advertisement

Answer

Quoting from this blog post:

Entry point is the javascript file that will be invoked when consumers of your module “require” it, this file will include the main logic for your module, or if it is a large module you can export public functions found with other files (typically in the lib directory)

So it should be your app.js file.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement