stemmlerjs / simple-typescript-starter Goto Github PK
View Code? Open in Web Editor NEWThe most basic TypeScript starter I could think of
Home Page: https://khalilstemmler.com/blogs/typescript/node-starter-project/
The most basic TypeScript starter I could think of
Home Page: https://khalilstemmler.com/blogs/typescript/node-starter-project/
I saw your blog. https://khalilstemmler.com/blogs/typescript/node-starter-project/
I am currently distributing TypeScript Express Starter as open source. However, I was solving a lint-related problem, and it seems to be a good resource.
We look forward to your good writing. :-D
Here is a VS Code Debug file in .vscode folder (${workspaceFolder}/.vscode or root dir + .vscode dir, or simple-typescript-starter-master/.vscode):
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/src/index.ts", // our main file
"sourceMaps": true,
"preLaunchTask": "npm: build",
"outFiles": [
"${workspaceFolder}/build/index.js"
]
}
]
}
This works for Console.log(""), but try it for:
import fs from 'fs';
const text = fs.readFileSync("README.md", "utf8");
console.log(text);
and it will fail with
C:\Program Files\nodejs\node.exe .\src\index.ts
Debugger attached.
Waiting for the debugger to disconnect...
...\simple-typescript-starter-master\src\index.ts:1
import fs from 'fs';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1072:16)
I am not a TS, Node and tricks person, but please add such a correct file, I would appreciate it.
Would be nice to have an example of how to import an external package through npm.
Hola Khalil, first of all, thank you for your nice starter repo π!
Have you considered enhancing your repo with information about testing?
...sorry, false project... ;-)
Just a useful tool to have
Can the packages in repo be updated to the lastest versions ?
I get this long list of update with ncu
@types/jest ^28.1.8 β ^29.5.8
@types/node ^18.6.1 β ^20.9.0
@typescript-eslint/eslint-plugin ^5.31.0 β ^6.10.0
@typescript-eslint/parser ^5.31.0 β ^6.10.0
eslint ^8.20.0 β ^8.53.0
eslint-config-prettier ^8.5.0 β ^9.0.0
eslint-plugin-jest ^26.6.0 β ^27.6.0
eslint-plugin-prettier ^4.2.1 β ^5.0.1
husky ^8.0.1 β ^8.0.3
jest ^28.1.3 β ^29.7.0
nodemon ^2.0.19 β ^3.0.1
prettier ^2.7.1 β ^3.0.3
rimraf ^3.0.2 β ^5.0.5
ts-jest ^28.0.7 β ^29.1.1
typescript ^4.7.4 β ^5.2.2
Currently https://github.com/stemmlerjs/simple-typescript-starter/blob/master/.vscode/launch.json file is pointing to "${workspaceFolder}/dist/**/*.js" but the ts is being compiled into build folder. This results in error when debugging the code containing imports
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.