Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferrymehdi/ts-setup
This project is a basic setup for developing a Node.js application using TypeScript, ts-node, and nodemon for automatic restarts during development.
https://github.com/ferrymehdi/ts-setup
nodejs nodets setup ts
Last synced: about 4 hours ago
JSON representation
This project is a basic setup for developing a Node.js application using TypeScript, ts-node, and nodemon for automatic restarts during development.
- Host: GitHub
- URL: https://github.com/ferrymehdi/ts-setup
- Owner: ferrymehdi
- Created: 2024-06-24T15:32:57.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-24T15:41:26.000Z (5 months ago)
- Last Synced: 2024-06-24T17:33:56.406Z (5 months ago)
- Topics: nodejs, nodets, setup, ts
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript Project Setup
This project is a basic setup for developing a Node.js application using TypeScript, ts-node, and nodemon for automatic restarts during development.
## Getting Started
### Prerequisites
Ensure you have Node.js installed. You can download it from [nodejs.org](https://nodejs.org/).
### Installation
1. **Clone the repository:**
```bash
git clone https://github.com/ferrymehdi/ts-setup.git
cd ts-setup
```2. **Install the dependencies:**
```bash
npm install
```### Project Structure
```
ts-setup/
├── src/
│ └── index.ts
├── .gitignore
├── nodemon.json
├── package.json
├── tsconfig.json
└── README.md
```### Configuration Files
- **`tsconfig.json`**: TypeScript configuration file.
- **`nodemon.json`**: Nodemon configuration file.### Available Scripts
- **`npm run build`**: Compiles TypeScript files to JavaScript.
- **`npm run dev`**: Runs the project in development mode with nodemon and ts-node.
- **`npm start`**: Runs the project directly using ts-node.### Running the Project
1. **Development Mode:**
```bash
npm run dev
```This will start the project with nodemon, which will watch for changes in the `src` directory and automatically restart the server.
2. **Production Mode:**
```bash
npm run build
npm start
```This will compile the TypeScript files into the `dist` directory and run the compiled JavaScript files.
### Example Code
You can find the example TypeScript code in `src/index.ts`:
```typescript
const sayHello = (name: string): string => {
return `Hello, ${name}!`;
};console.log(sayHello("World"));
```### License
This project is licensed under the ISC License.