什么是“入口点"?在npm init中 [英] What is "entry point" in npm init

查看:42
本文介绍了什么是“入口点"?在npm init中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个空的新项目,当我运行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)

我真的很困惑入口点",这应该是我的index.html文件还是我的app.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?

推荐答案

从此

入口点是当使用者使用时将调用的javascript文件您的模块需要"它,该文件将包含用于您的模块,或者如果它是一个大模块,则可以将其公共导出与其他文件(通常在lib目录中)一起找到的功能

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)

因此它应该是您的 app.js 文件.

So it should be your app.js file.

这篇关于什么是“入口点"?在npm init中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆