Below is my project location on the GitHub:
https://github.com/nandy2013/MERN-Stack-Dev
I am just trying to import the method from the js file on another js file with below implementation:
is-empty.js
const isEmpty = value =>
value === undefined ||
value === NULL ||
(typeof value === 'object' && Object.keys(vale).length === 0) ||
(typeof value === 'string' && value.trim().length === 0);
module.exports = isEmpty;
register.js
//code
import isEmpty from './is-empty';
//code
Snippet:
I am getting below error message
C:\Users\1217688\Desktop\devconnector\validation\register.js:2 import isEmpty from './is-empty'; ^^^^^^
SyntaxError: Unexpected token import at new Script (vm.js:51:7) at createScript (vm.js:138:10) at Object.runInThisContext (vm.js:199:10) at Module._compile (module.js:624:28) at Object.Module._extensions..js (module.js:671:10) at Module.load (module.js:573:32) at tryModuleLoad (module.js:513:12) at Function.Module._load (module.js:505:3)
Any help please!