Initialize TypeScript project with basic configuration and example function

This commit is contained in:
Dominik Krenn 2025-07-17 22:28:38 +02:00
parent 147d7ce5da
commit 622a4de5fa
7 changed files with 60 additions and 0 deletions

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# TypeScript output
dist/
*.tsbuildinfo
# Node modules
node_modules/
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# System files
.DS_Store
Thumbs.db
# IDE stuff
.vscode/
.idea/
*.swp
# Env stuff
.env

5
.npmignore Normal file
View File

@ -0,0 +1,5 @@
src/
test.ts
tsconfig.json
*.log
node_modules/

0
index.js Normal file
View File

12
package.json Normal file
View File

@ -0,0 +1,12 @@
{
"name": "testosmaximus",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

3
src/index.ts Normal file
View File

@ -0,0 +1,3 @@
export function crackNut(nut: string): string {
return `*CRACK!* The ${nut} has been broken by pure TypeScript violence.`;
}

3
test.ts Normal file
View File

@ -0,0 +1,3 @@
import { crackNut } from './src/index';
console.log(crackNut('hazelnut'));

14
tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "Node",
"outDir": "dist",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"include": ["src"]
}