
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.

Jump to all commands with their usage and description.
DM-Tools is a command-line utility for generating a project for the following programming languages.
Focus has been put into encouraging the use of best practices and the best tools.
Version of Node supported: Node v14.16.1+, for version earlier you will need to polyfill using "core-js".
Both No IDE browser debugger and VSCode debugger support is provided.
Make sure project is open in VSCode. To get started open a terminal and type:
npn run debug
This will start a debug build for TypeScript files in development build mode then run it using Node.js and immediately break. JavaScript program will run immediately and break.
From VSCode press "F5" to run the debugger, it will attached to the started Node.js program in break mode. Step through the code or pressed "F5" to continue executing the program.
Set breakpoints 🎯 and step through code like a debugging pro. 😎
Feel free to edit make code edit, this will cause a rebuild on file save. You will need to re-start the debugger and press "F5" after a new build.
You can easily run and debug any TypeScript, JavaScript, Node.js program with ease. You do not need and IDE to debug! 💪🏽 All you need is a terminal and a browser and you can step through any code.
It is even possible to debug remotely, for more information, read the Node Debugging Guide.
To get started open a terminal and type:
npm run debug
This will start a debug build for TypeScript files in development build mode then run it using Node.js and immediately break. JavaScript program will run immediately and break.
Next open a browser.
| Browser | Debug URL |
|---|---|
| Brave | brave://inspect |
| Chrome | chrome://inspect |
| Edge | edge://inspect |
Look for an "Open dedicated DevTools for Node" or "inspect" link.

Clicking on either link will popup a browser debug window. You are good to go. ✅
Set breakpoints 🎯 and step through code like a debugging Wizard. 🧙🏽♂️

NOTE: TypeScript file(s) will appear in the debugger windows, not transpiled JavaScript files. ❤️
npm install -g dm-tools
This will make the command "dm" available from the terminal.
On Linux you can set the 'EDITOR' environment variable to point to the location of the source code editor of your choice. It will open up under the root directory of the project just created.
Determine the location of your IDE (vscode or vscode-insider).
Add something like the following to your Bash configuation file: "~/.bashrc".
export EDITOR="/usr/local/bin/code-insiders"
Use the "-h" or "--help" option to view help on usage.
$ dm -h
Usage: dm <command> <project> [options...]
commands: new
Options:
-v, --version Show current version
-t, --type <type> Node.js project types: koa, node, pg, ts, web
--e2e end to end testing
-w, --web simple static Web setup
--cpp [items] C++ project
-D, --debug C++ debug build
--release C++ release build
-M, --make C++ Unix Makefile build
--xcode C++ XCode Makefile
--eclipse C++ Eclipse CDT4 Makefile
-N, --nmake C++ Window NMak Makefile
-h, --help display help for command
Dev Mentor DM-Tools
Create C++, TypeScript and JavaScript projects.
Website: https://www.npmjs.com/package/dm-tools
Here are the benefits you will enjoy right out of the gate:
Start playing with the demo starter project now, the generated source code is located in the project "src/" sub-folder.
dm new demo
cd demo
Note: If you are using DM-Tools generated project will use pnpm, yarn, npm in this order, if any are installed on your system.
To create a specific started project type, use the following syntax:
dm new <project-name> -t <type>
The following basic project types that can be created using DM-Tools are:
NOTE: Default project type is "ts" if not type passed.
| Type | Language | Description |
|---|---|---|
| ts | TS | TypeScript Express.js Server (Zero compile with static Website) |
| pg | TS | TypeScript PostgreSQL Express.js Server. |
| web | HTML Sass | Static Website. |
| node | TS | TypeScript Node.js Server. |
| koa | TS | Koa Node.js API Server in TypeScript. |
| cpp | CPP | C++ with Micro Test using CMake. |
The following NPM commands you will be using with your project are:
| NPM Scripts | Description |
|---|---|
| dev | Development build and watch mode. |
| debug | Start a debug session, attach to process (usually press F5). |
| test | Run Unit test. |
| test:coverage | Run Unit test with coverage. |
| test:watch | Run Unit test in watch mode. |
| test:e2e | End to end test with Playright. |
| web | Start static web server. Play with HTML, CSS. |
| build | Build the project for production. |
| release | Build the project for production. |
| start | Run built Node.js program. |
| check | Perfrom TypeScript typechecking. |
| lint | Lint the source code. |
| format | Format the source code. |
| doc | Generate doc files (jsdocs). |
IMPORTANT: Since gazeall is being used to watch and rebuild file, do not call other NPM script from it with watch-mode enabled. This can result in execution problems and the build entering a cycle of repeated rebuilds.
To simply run a production build of the Node.js program, type:
npm start
This will perform a clean build and run the demo program from the "build/" folder. The demo application log will be produced in the "logs/" sub-folder under the project root.
To run tests with coverage for the TypeScript / Node.js based programs, type:
npm test
It might be a good idea to run all the tests with coverage before a production build.
You can run and watch a Node.js based program during development. To do this, open a terminal and type the following.
npm run dev
This will kickoff the "dev build" and "dev watch" NPM scripts.
To watch the unit tests while developing, type the following command in a new terminal.
npm run testwatch
Place all TypeScript source code under the folder, "src/", they will be picked up from here and compiled to the, "build/" folder under the project root.
You are free to create addition folders and sub-folders under, "src/", the compiler will recursively find and compile all TypeScript code.
All TypeScript code is compiled to ES2020 JavaScript. The target JavaScript code can be changed from the TypeScript configuration file, "tsconfig.json".
Some of the things you may want to configure:
Some of the supported compiled targets include:
ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ESNext
See compiler options for more details.
To compile the TypeScript code, use the following command to start the build process:
npm run release
The "build/" folder and all sub-folders within it will be deleted to insure a clean build is performed each time. Do not place any files you will need later in the "build/" folder.
Place any module or library source code that you write under the, "src/lib/", sub-folder. The compiled source code will be output to the, "build/lib/", sub-folder.
The source code will be automatically formatted during development and production build. This will also happen before source code is committed to Git.
It is good practice to format the source code, so it conforms to a uniform structure. Avoid squabbles about style. Formatting in run by the NPM script, "format".
To validate the project TypeScript source code, use the following command:
npm run lint
Note: The TypeScript source code is run through a linter (ESLint) before a build and before it is committed to the Git repository. Any errors encountered must be fixed before the Git commit is allowed to proceed.
Important!: I have noticed, once in a while the git hooks will continue to fail when there is nothing really wrong. If you suspect this is the case, the easy fix is to delete the "node_modules" folder. Follow this with a "npm install" or simply type "yarn" and then try to commit or push the code again.
Testing is done using Jest, the test methods are simple and easy to learn.
The test code should be co-located with the production source code. As a best practice, place tests under a sub-folder called "test/".
Pay attention to how the test source file is named: "test.<file>.ts". So if you have a file called, "filter.ts", the test file should be named, "test.filter.ts".
To run the test, type:
npm test
Note: Running the test will cause a fresh build to be kicked-off. Once the build finishes, all the unit tests will be run.
If you want to hack around with HTML, Sass and try things out quick. Start the project in web mode using the following command:
npm run web
This will run the build first and then open a web browser on port 3000, and load the HTML page, "index.html" located in the "src/" sub-folder.
Any changes made to "index.html" will automatically update and browser on save. You do not need to keep hitting refresh on the browser.
The website uses lite-server, which is based on Browsersync to run a local development web-server and keeps all browsers listening to it in sync. This means it is possible to have multiple browsers listening to the server.
On how to configure the setup, read the Browsersync options.
Basic configurations setting you may be interested in are:
The default Browsersync UI web address is: http://localhost:3001/.
With Browsersync, having to serve addition CSS and JavaScript files, make sure to add their path in routes. Something similar to like this:
"server": {
baseDir: "src",
routes: {
"/node_modules/tachyons/css":"node_modules/tachyons/css"
}
},
This will allow including "<script>" assets from the index.html file like this:
<head>
<link rel="stylesheet" href="./node_modules/tachyons/css/tachyons.min.css">
</head>
Test coverage is done when test is run using "nyc". The test coverage result is displayed to the console after the results of the unit tests. A folder called "coverage/" will be created under the project root. It will hold the results of the code coverage from the test run. Of interest to you will be the HTML report. It is a nice way to see what code was covered and what code was not by the unit tests.
To configure the test coverage, make changes to the "nyc" settings found in the file "package.json".
If you want to develop in plain JavaScript, or develop a ES6 Node.js based project, this is now supported. It is also good for quickly testing out code and not getting slowed down by the compile step.
You will need the latest version of Node.js for ES6 and beyond support, otherwise plain JavaScript will continue to work.
dm new demo --type js
npm install
Note: You may also use "-t" which is the short-form for "--type".
The plain JavaScript generated file has a development mode. It will run the Entry file ("main.js") using Node.js each time the source code is updated. You can develop and see the output from the terminal to test out code quickly.
npm run dev
If you need to use ES5 Node.js support with TypeScript here are the following change you need to make.
Make sure you're using Node v14.16.1 or higher.
Add the following two lines under compilerOptions to "tsconfig.json" and "tsconfig.test.json".
"compilerOptions": {
"target": "es2020",
"lib": [
"es2020",
"es2019",
"es2018",
"es2017",
"dom"
]
}
DM-Tools can be used to create a C++ project with Unit Testing setup using Micro Test.
The C++ project uses CMake to generate cross-platform Makefiles for:
Let us go through the steps of creating a simple "hello_world" project.
The created project will be found under the hello_world folder.
cd /tmp
dm new hello_world --cpp
The Makefile is located under sub-folder build.
cd hello_world/build
make
The executable hello_world will be found in the build folder.
./hello_world
The test program is located under build/test/ sub-folder. Initially one failing test is created for you to follow.
./test/test.hello_world
DM-Tools creates a test sub-folder under src/ and uses the latest Micro Test header file, it basically pulls it from the Micro Test Git repository.
To learn more about how to write tests using Micro Test check out the project site. You will be amazed how simple and fast it is to write test code.
Read the coding guideline found in the wiki.
If you get a post or address is use, you might have a background process that didn't shutdown correctly. To shut it down, use the following command to find its process ID and then kill it.
lsof -i :PORT
lsof -i :3000
kill <PIDP>
kill -9 <PIDP>
Happy Hacking =)
FAQs
Dev Mentor Project Creator Tools
The npm package dm-tools receives a total of 23 weekly downloads. As such, dm-tools popularity was classified as not popular.
We found that dm-tools demonstrated a healthy version release cadence and project activity because the last version was released less than 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.