InstantSplit/install-node-types.sh

26 lines
726 B
Bash
Raw Permalink Normal View History

2025-06-21 23:30:33 +03:00
#!/bin/bash
# Script to install Node.js type definitions for TypeScript
echo "๐Ÿ” Installing @types/node for TypeScript support..."
# Install types for Node.js
npm install --save-dev @types/node
# Update tsconfig.json to include node types
cat > tsconfig.node.json << EOL
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"types": ["node"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.js"]
}
EOL
echo "โœ… Node.js types installed!"
echo "To use Node.js types, extend your tsconfig.json with tsconfig.node.json"
echo "or run your TypeScript compiler with --types node"