
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
nginx-config-formatter
Advanced tools
A formatter for Nginx config files. Both API and CLI are available.
Features from nginxbeautifier
Plus we have:
{
or before }
are trimmednpm i -g nginx-config-formatter
Or
pnpm i -g nginx-config-formatter
nginx-config-formatter -p /etc/nginx
available options:
-p, --path (required) the path of files to be formatted. Support glob syntax
-h, --help display usage help
-i, --indentStyle style of indentation, space or tab, defaults to space
-c, --dontJoinCurlyBracket if true, the opening bracket starts with a new line, defaults to false
-a, --align align the values of all directives in the same block, defaults to false
-l, --trailingBlankLines Append a trailing blank line after the opening bracket, defaults to false
-ext, --extension the file extension of nginx config files, defaults to conf
formatFile(path: string, options?: OptionType): Promise<void>
path
can be the path of a .conf
file, or a folder contains .conf
file. Glob syntax is also supported. If a folder is provided, all .conf
files including those in its sub folders will be formatted.
formatContent(content: string, options?: OptionType): string
content
is the full content of a config file. Returns a string of the formatted content.
The APIs above accepts a option object. All options are optional and its default value is the same as the CLI.
interface OptionType {
indentStyle?: 'space' | 'tab'
dontJoinCurlyBracket?: boolean
align?: boolean
trailingBlankLines?: boolean
extension?: string
}
import { formatFile } from 'nginx-config-formatter'
formatFile('/etc/nginx', {
indentStyle: 'tab'
})
See CHANGELOG
This project is inspired by nginxbeautifier and use some of its code.
If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.
Thank you.
FAQs
A formatter for Nginx config files
The npm package nginx-config-formatter receives a total of 4,179 weekly downloads. As such, nginx-config-formatter popularity was classified as popular.
We found that nginx-config-formatter 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.