Skip to content

Instantly share code, notes, and snippets.

@Jaakkonen
Last active July 8, 2024 23:47
Show Gist options
  • Select an option

  • Save Jaakkonen/4672efd87fcf2e58bd8f57067e743a42 to your computer and use it in GitHub Desktop.

Select an option

Save Jaakkonen/4672efd87fcf2e58bd8f57067e743a42 to your computer and use it in GitHub Desktop.
NodeJs commonjs import challenge
import { UndirectedGraph } from "graphology";
const a = new UndirectedGraph();
{
"name": "demo",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@swc/core": "^1.6.13",
"graphology": "^0.25.4",
"ts-node": "^10.9.2",
"typescript": "^5.5.3"
},
"type": "module"
}
#!/bin/sh
npx node --loader=ts-node/esm index.ts
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./dist",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment