Skip to content

Instantly share code, notes, and snippets.

@carloscasalar
Created March 21, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carloscasalar/04539f3945d584382537d4ef0468a0f5 to your computer and use it in GitHub Desktop.
Save carloscasalar/04539f3945d584382537d4ef0468a0f5 to your computer and use it in GitHub Desktop.
Simple plain node setup with module imports
import {otherConst} from "./other-file.js";
import someData from './some-data.json' assert { type: "json" }
console.log('hola');
console.log(otherConst);
const {some} = someData;
console.log(some);
export const otherConst = 'bla ble blu';
{
"name": "nodetest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "",
"license": "ISC",
"volta": {
"node": "18.15.0",
"npm": "9.5.1"
}
}
{
"some": "data"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment