
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.
A JavaScript implementation of the dprint CLI for code formatting. This tool provides the core functionality of dprint, allowing you to format source code files using dprint's plugin system.
# install with your package manager
bun add -D dprint-cli @dprint/{typescript,json}
npm install -D dprint-cli @dprint/{typescript,json}
# or run directly
bunx dprint-cli
npx dprint-cli
dprint.json for configuration with include/exclude patternsinit - Initialize a new configuration filefmt - Format files and write changescheck - Check if files are formatted correctlyFirst, install the dependencies:
npm install
Make the CLI executable:
chmod +x bin/dprint
Optionally, link it globally:
npm link
Create a new dprint.json configuration file in the current directory:
node bin/dprint init
Format all files according to the configuration:
node bin/dprint fmt
Format specific files or patterns:
node bin/dprint fmt src/**/*.ts
node bin/dprint fmt -- src/**/*.ts test/**/*.js
Check if files are formatted correctly without modifying them:
node bin/dprint check
Check specific files:
node bin/dprint check src/**/*.ts
The dprint.json file configures which files to format and how. Example:
{
"$schema": "https://dprint.dev/schemas/v0.json",
"projectType": "openSource",
"incremental": true,
"includes": ["**/*.{ts,tsx,js,jsx,json,md}"],
"excludes": [
"**/node_modules",
"**/*-lock.json",
"**/dist",
"**/build",
"**/coverage"
],
"plugins": [
"@dprint/typescript",
"@dprint/json",
"@dprint/markdown"
],
"typescript": {},
"json": {},
"markdown": {}
}
Plugins are loaded from your node_modules directory. Make sure to install the required plugins:
npm install @dprint/typescript @dprint/json @dprint/markdown
The plugins in dprint.json should match npm package names installed in your project.
dprint.json starting from the current directory and walking up the directory tree# 1. Initialize project
node bin/dprint init
# 2. Install formatter plugins
npm install @dprint/typescript @dprint/json @dprint/markdown
# 3. Format your code
node bin/dprint fmt
# 4. Check formatting in CI
node bin/dprint check
USAGE:
dprint <SUBCOMMAND> [OPTIONS] [--] [file patterns]...
SUBCOMMANDS:
init Initializes a configuration file in the current directory
fmt Formats the source files and writes the result to the file system
check Checks for any files that haven't been formatted
help Shows this help message
OPTIONS:
-- Treat all following arguments as file patterns
bun test
MIT
FAQs
JavaScript implementation of dprint CLI for formatter
We found that dprint-cli 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.