https://github.com/trasherdk/node-test-snippets
Minimal code snippets to test stuff
https://github.com/trasherdk/node-test-snippets
Last synced: about 1 year ago
JSON representation
Minimal code snippets to test stuff
- Host: GitHub
- URL: https://github.com/trasherdk/node-test-snippets
- Owner: trasherdk
- License: mit
- Created: 2022-03-23T04:33:42.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-25T03:38:59.000Z (over 1 year ago)
- Last Synced: 2024-10-26T17:13:32.793Z (over 1 year ago)
- Language: JavaScript
- Size: 813 KB
- Stars: 0
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-test-snippets
Minimal code snippets to test stuff
# typescript examples
To launch ts code from command line, this seems to be the way:
```sh
node --experimental-specifier-resolution=node --loader ts-node/esm path/to/example/
```
or even
```sh
node --loader ts-node/esm path/to/example/
```
`tsconfig.json` need the `module` and `target` set to something recent.
```json
{
"compilerOptions": {
"esModuleInterop": true,
"module": "ESNext",
"target": "ES2020"
},
"include": [
"./**/*.ts"
]
}
```