
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
string-width-carroll-lindgren
Advanced tools
A full fledge template to create react-npm-package on the fly. This template took care of CI/CD setup of that package as well.
Welcome to Quick Start Node, a template repository to kickstart your Node.js projects with a solid foundation and best practices.
Quick Start Node provides a generic starting point for your Node.js projects, complete with a well-organized project structure, common dependencies, and essential configurations. It's designed to help you save time and ensure consistency across your projects.
Follow these steps to get your project up and running:
cd quick-start-node.npm install.cat ./env/example.json | tee ./env/development.json ./env/production.json ./env/test.json > /dev/null.npm run startThis template covers the basic structure and setup of a Node.js project. You can adapt it for various types of applications:
src/routes and src/controllers directories.src/models directory.src/middleware directory.index.js file.development.json, test.json and production.json in same directory and add or change the data. You can run this in in your package root also cat ./env/example.json | tee ./env/development.json ./env/production.json ./env/test.json > /dev/null.npm run dev.npm run test:unitnpm run test:integrationFor other dependencies please check package.json file.
You can use these commands to print your project tress:
CMD: tree /A /F | findstr /V /C:"node_modules"
POWERSHELL: Get-ChildItem -Recurse | Where-Object { $_.FullName -notlike "*\node_modules\*" } | ForEach-Object { $_.FullName }
UBUNTU (WSL): tree --prune -I 'node_modules' --dirsfirst or tree -a -I 'node_modules|.git' --dirsfirst
quick-start-node/
├── .github
│ └── workflows
│ └── build-lint-test.yml
├── .vscode
│ ├── extensions.json
│ └── settings.json
├── env
│ ├── development.json
│ ├── example.json
│ ├── production.json
│ └── test.json
├── logs
│ ├── error.log
│ ├── uncaught-exceptions.log
│ └── unhandled-rejections.log
├── public
│ ├── data
│ │ ├── http-status-codes.js
│ │ └── programming-error-codes.js
│ ├── images
│ │ ├── avatar1.png
│ │ └── avatar2.png
│ └── styles
│ └── index.min.css
├── src
│ ├── assets
│ │ └── scss
│ │ ├── _about-us.scss
│ │ ├── _contact-us-email-template.scss
│ │ ├── _contact-us.scss
│ │ ├── _footer.scss
│ │ ├── _header.scss
│ │ ├── _home.scss
│ │ ├── _page-not-found.scss
│ │ ├── _variables.scss
│ │ └── index.scss
│ ├── configurations
│ │ ├── index.js
│ │ ├── logger.js
│ │ ├── mongo-atlas.js
│ │ ├── nodemailer.js
│ │ └── set-environment-config.js
│ ├── controllers
│ │ ├── auth-controller.js
│ │ ├── index.js
│ │ ├── pages-controller.js
│ │ ├── reset-password-controller.js
│ │ └── user-controller.js
│ ├── middlewares
│ │ ├── async-error-handler.js
│ │ ├── index.js
│ │ ├── is-authenticated-middleware.js
│ │ ├── is-valid-object-id-middleware.js
│ │ ├── log-request-info-middleware.js
│ │ ├── uncaught-errors-middleware.js
│ │ ├── use-middlewares.js
│ │ └── validate-and-sanitize-request-middleware.js
│ ├── models
│ │ ├── Temporary-Token.js
│ │ ├── User.js
│ │ └── index.js
│ ├── routes
│ │ ├── auth-route.js
│ │ ├── index.js
│ │ ├── pages-route.js
│ │ ├── reset-password-route.js
│ │ └── user-route.js
│ ├── utilities
│ │ ├── format-error.js
│ │ ├── format-response.js
│ │ ├── get-project-name.js
│ │ ├── index.js
│ │ └── string-utilities.js
│ ├── validators
│ │ ├── auth-validators.js
│ │ ├── index.js
│ │ ├── pages-validators.js
│ │ ├── reuseable-validators.js
│ │ └── user-validators.js
│ └── views
│ ├── components
│ │ ├── footer-mixin.pug
│ │ └── header-mixin.pug
│ ├── emails
│ │ └── email-template.pug
│ ├── about-us.pug
│ ├── contact-us.pug
│ ├── home.pug
│ └── page-not-found.pug
├── tests
│ ├── integration
│ │ └── routes
│ │ └── user.test.js
│ ├── unit
│ │ ├── configs
│ │ │ └── mongo-atlas.test.js
│ │ ├── middlewares
│ │ │ └── is-authenticated.test.js
│ │ └── models
│ │ └── User.test.js
│ └── setup.js
├── .eslintrc.json
├── .gitignore
├── LICENSE
├── README.md
├── index.js
├── package-lock.json
└── package.json
is-authenticated-user.js).user-route.js, user-controller.js, user-middleware.js.User).User-Class.js).The project employs a meticulous folder structure to uphold a neat and methodical codebase:
/public: Serves as the repository for static files./env: Hosts environment and confidential files, catering to various environments. Files such as development.json, test.json, and production.json are ignored; however, an illustrative example.json is included./tests: Houses test files, further categorized into:
/unit: Reflects the /src structure, housing unit tests./integration: Resonates with the /src layout and contains integration tests./src: The primary source folder, home to JavaScript files and a spectrum of subfolders encompassing distinct components:
/assets: Designated for assets, including SCSS and more./configurations: Houses assorted settings like MongoDB, logger, and nodemailer./controllers: Encompasses code pertinent to route handlers./middlewares: Hosts middleware modules catering to application logic./models: Encapsulates schemas and methods tailored for database models./routes: Holds handler functions for diverse API endpoints./utilities: Features utility functions and classes./validators: Contains validation logic dedicated to user data./views: Nurtures the creation of views and components via the Pug templating engine.Routes are created using Express.js routes. Some of them are:
/api//api/about-us/api/contact-us/api/users//api/users/me/api/users/:userId/api/auth/login/api/auth/logout/api/reset-passwordSome of the status codes used are see all here in a file:
200 Used when you get data successfully.201 Used when your data created successfully.400 Used when there is bad request from the client.401 Used when user is not authenticated.403 Used when user is authenticated but do not have permissions to access resource.404 Used when data not found.422 Used when payload key(s) is valid but the data in the key(s) are unprocessable.500 is used for internal server error.Contributions are welcome! If you encounter issues or have improvements to suggest, please create a pull request.
Thank you for considering contributing to this project!
This project is licensed under the MIT License.
FAQs
A full fledge template to create react-npm-package on the fly. This template took care of CI/CD setup of that package as well.
We found that string-width-carroll-lindgren demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.