当前位置:网站首页>Module import method of node
Module import method of node
2022-06-21 18:28:00 【CupidoZ】
Module import mode
If you follow es6 Standard writing
node Use export Whether keyword screen can export files
node Use import Whether the keyword screen can import files
const ModuleA = {
getName(){
return 'moduleA ran...'
}
}
export default ModuleA
import ModuleA from "./module/moduleA.js";
console.log(ModuleA.getName())
{
"name": "moduledemo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "cupido",
"license": "ISC"
}
边栏推荐
- Node的json解析
- Post Gartner webinar "nine questions on digital transformation"
- 服务端socket程序
- 我被变相降薪了
- RT thread persimmon pie M7 Quanzhi f133 DDR running xboot
- Window常用快捷键
- Development of digital collection system and construction of NFT artwork trading platform
- Typescript的泛型
- TypeScript的一些基本特征
- 高考后网上查询信息,注意防范没有 SSL证书的网站
猜你喜欢

RMB 18billion, a super master fund was born in Suzhou

是关于Linux中一步建立yum源缓存问题

AI自己写代码让智能体进化!OpenAI的大模型有“人类思想”那味了

Technical architecture of large websites | information encryption technology and key security management

Operation of simulation test platform for test questions bank of R1 quick opening pressure vessel operation certificate in 2022

How to create your own AI creativity?

【微服务|Nacos】快速实现nacos的配置中心功能,并完成配置更新和版本迭代

EtherCAT igh主站控制3个台达asdaa2伺服转圈圈

Paper notes ACL 2022 unified structure generation for universal information extraction

研发仅占3%的蕉下,是防晒黑科技,还是夏天的智商税?
随机推荐
EtherCAT igh master station controls Esther servo to return to zero
Postman association to complete interface automation test
TypeScript的类型检查
EtherCAT object dictionary analysis
使用jmeter做Web端自动化测试
EtherCAT igh函数尝试
AI自己写代码让智能体进化!OpenAI的大模型有“人类思想”那味了
PHP输出函数
大型网站技术架构 | 应用服务器安全防御
现有需求同步其他数据库用户信息到我们系统他们主键id为string我们主键为Long
POSIX create terminate thread
Stack cognition -- basic use of reverse IDA tools
力扣142. 环形链表 II
LeetCode 1108 IP地址无效化[暴力] HERODING的LeetCode之路
Redis6.0 new features (Part 1)
nest.js实战之模块依赖传递性
What is the S3 protocol that we are talking about every day? This article takes you to understand the story behind S3
基本文件操作
Node输出方式
【微服务|Nacos】Nacos实现分布式配置中心进阶版