An Effective Node.js Setup for TypeScript Projects — to start fast.
I use Node.js for almost every back-end project I create. Here's a boilerplate repo that I have been reusing for these projects.
Try it out for your next project or share what your structure looks like.
- Clone the repo:
git clone https://github.com/fariasmateuss/boilerplate-for-nodejs.git
- Install dependencies:
yarn
- Run development server:
yarn dev:server
When you import a file, you can either use a relative or absolute path.
import { PayPalClient } from '../../services/PayPal'
Previous example can be rewritten to.
import { PayPalClient } from '@services/PayPal'
In this example everything that starts with @
will be loaded from src/
. I like to call it @
as it becomes easy to know whenever you’re importing something from your app rather than a NPM module.
If you found this useful, please help us improve it by contributing.
If you have any ideas or feedback for this project, please let me know. Connect with me on Twitter or LinkedIn.
This project is licensed under the MIT License.