I'm learning node.js and am wondering why it uses the require
syntax rather than the import
syntax which React uses.
i.e.
const Validator = require("validator");
VS
import Validator from "validator";
I believed import
is es6 but I don't think that explains why it's not used in node.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…