
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
grunt-esformatter
Advanced tools
Format JavaScript files using esformatter.
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-esformatter --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-esformatter');
Run this task with the grunt esformatter command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Files are formatted with esformatter.
Type: String
Default: undefined
Pick one of the presets that esformatter bundles. If you don't specify the option, the default preset is used.
Type: Boolean
Default: false
If you're formatting a script that contains a first line starting with "#!": for example when you're writing scripts that are executable by themselves, set this option to make the task remove this line before formatting it, then put it back after formatting. Here's an example of such a script:
###!/usr/bin/env node
scriptCodeHere();
By default, if you format a file with esformatter that includes this line, the parser (esprima) will throw an exception, pointing out that first line as an "illegal token". Which makes sense in the context of browser scripts, where the parser would throw the same error.
Type: Object
Default: undefined
These are the top-level configuration properties for esformatter. You can specify any of the nested properties to overwrite settings from the chosen preset.
Once there is documentation available for these, a link will be added. Until then you have to look at the esformatter source code.
esformatter: {
src: 'src/**/*.js'
}
esformatter: {
options: {
preset: 'jquery'
},
src: ['src/parser.js', 'src/formatter.js']
}
esformatter: {
four_space_indent: {
options: {
indent: {
value: ' '
}
},
src: 'file1.js'
},
jquery_two_space_indent: {
options: {
preset: 'jquery'
indent: {
value: ' '
}
},
src: 'vendor/*.js'
}
}
Copyright Jörn Zaefferer. Licensed under the MIT license.
FAQs
Format JavaScript files.
The npm package grunt-esformatter receives a total of 99 weekly downloads. As such, grunt-esformatter popularity was classified as not popular.
We found that grunt-esformatter 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.