node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



A cli tool to change the indentation type in multiple files.


npm i batch-indent -g


batch-indent -p "./src/**/*.js" -f 3-spaces -t tabs

Possible arguments are:


-p ./src/**

Glob pattern to match files.


-f 2-spaces

Type of indentation to find.


-t tabs

Type of indentation to convert to.

Indentation types

The indentation type passed to --from and --to must be one of the following:

  • tabs
  • 1-space
  • 2-spaces
  • 3-spaces
  • 4-spaces
  • 5-spaces
  • 6-spaces
  • 7-spaces
  • 8-spaces