Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

esbeautifier

royriojas519MIT10.1.1

Simple wrapper around esformatter to beautify javascript files overriding the content of the files

esformatter, beautifier, javascript, code, beautifier, jsx, prettyprint, prettify

readme

NPM Version Build Status

esbeautifier

Simple wrapper around esformatter to beautify javascript files overriding the content of the files

Motivation

esformatter only format the output to the stdout. This tool will overwrite your files. Use it under your own risk.

Install

npm i -g esbeautifier

Usage

Usage: esbeautifier [options] glob [glob1] [glob2]..[globN]

Options:
  -k, --check-only       Will just run the beautifier and report which files need to be beautified
  -i, --cache-id String
      An identifier for the cache file to create. This is only needed if you want to run this task in
      parallel otherwise the next execution might get confusing results for reusing the same cache
      file.
  -u, --use-cache
      If true, this module will remember the `mtime` and `size` of the beatufied files and only
      operate on the ones that changed. If false, the cache will be destroyed. Cache will only be
      kept between executions with the useCache flag set to true. - default: true
  -h, --help             Show this help
  -v, --version          Outputs the version number
  -q, --quiet            Show only the summary info - default: false
  --colored-output       Use colored output in logs
  -c, --config String    Path to your `esformatter` config, if not provided will try to use the
                         `.esformatter` file in your current working directory, if not found will use
                         the one provided with this package

Examples

# this will overwrite your files! this is usually what you want thought
esbeautifier src/**/*.js specs/**/*.js

# check only which files need beautification
# if at least one file require beautification the command will throw an exception
esbeautifier src/**/*.js -k

# skip the cache. It will be created the next execution without this flag
esbeautifier --use-cache=false src/**/*.js

Note

The cache is only kept if the executions of the beautifying command is done without the --use-cache=false or --no-use-cache flags. If any execution include this flag the cache will be destroyed and created again from scratch the next execution without it.

Changelog

changelog

esbeautifier - Changelog

v10.1.1

v10.1.0

v10.0.0

  • Build Scripts Changes

v9.0.0

  • Features

    • Update to latest esformatter and esformatter-jsx - 9c943e3, [Roy Riojas](https://github.com/Roy Riojas), 27/03/2016 03:12:12

      BREAKING CHANGE

      The esformatter-collapse-objects plugin was removed due to complexity to obtain the desired results

v8.0.6

v8.0.5

  • Bug Fixes
    • locking deps to prevent issues with latest esformatter - 61c3560, royriojas, 29/01/2016 17:42:02

v8.0.4

  • Build Scripts Changes
    • Update esformatter-jsx to latest to fix some bugs - d1b15c1, royriojas, 01/12/2015 14:41:59

v8.0.3

  • Features
    • support async ArrowFunctionExpressions and Decorators in classMethods - c8f091c, royriojas, 30/11/2015 14:07:51

v8.0.2

  • Build Scripts Changes

v8.0.1

  • Bug Fixes

v8.0.0

  • Build Scripts Changes
    • Update to latest version of esformatter-jsx to properly handle the async tokens - 68445ab, [Roy Riojas](https://github.com/Roy Riojas), 22/11/2015 16:36:13

v7.0.0

  • Build Scripts Changes

v6.1.9

  • Build Scripts Changes

v6.1.8

  • Bug Fixes

v6.1.7

v6.1.6

  • Bug Fixes
    • Properly handle ES7 decorators that are expressions - eff0371, royriojas, 08/10/2015 13:46:12

v6.1.5

  • Build Scripts Changes
    • Update esformatter-jsx dep to include fix for NamedExportDeclaration - 87df818, royriojas, 06/10/2015 19:55:23

v6.1.4

  • Build Scripts Changes
    • lock dependencies to a specific commit in github - ccd58c1, royriojas, 02/10/2015 12:29:48

v6.1.3

  • Bug Fixes
    • Issue with the parser returning negative indexes - cb9f95e, royriojas, 02/10/2015 02:14:33

v6.1.2

  • Features
    • Support SpreadProperties outside of JSX blocks - a8c90ce, royriojas, 02/10/2015 01:36:38

v6.1.1

v6.1.0

  • Features

v6.0.4

  • Refactoring
    • update esformatter-jsx to support ignore-blocks - a0650a5, royriojas, 01/10/2015 21:44:14

v6.0.3

  • Enhancements
    • properly ignore blocks of code from the formatter - acf8a87, royriojas, 01/10/2015 12:28:07

v6.0.2

  • Enhancements
    • use esformatter-ignore inside esformatter-jsx - 22aebee, royriojas, 01/10/2015 01:43:58

v6.0.1

  • Bug Fixes
    • properly expand/inline objects/arrays based on the size - 0e28e72, royriojas, 24/09/2015 02:12:46

v6.0.0

  • Enhancements

v5.1.2

  • Enhancements
    • use the current working directory as an id - 15b7e56, royriojas, 23/09/2015 23:06:57

v5.1.1

  • Enhancements
    • destroy the cache when the configuration options change - 73267e9, royriojas, 23/09/2015 22:30:24

v5.1.0

  • Enhancements
    • Add esformatter-ignore to be able to let some blocks of code to not be formatted - e7ed32e, royriojas, 22/09/2015 00:13:01

v5.0.1

  • Enhancements
    • Install from the fork to avoid inadverted updates - 32b4be2, royriojas, 19/09/2015 14:23:59

v5.0.0

  • Enhancements
    • update esbeautfier to latest esformatter to get support for ES6 - 05bd249, royriojas, 18/09/2015 01:51:42

v4.2.12

  • Enhancements
    • update esformatter-jsx to support spread operators - 133e10c, royriojas, 18/09/2015 01:41:40

v4.2.11

  • Bug Fixes
    • Make sure the right clix module is loaded - 829aafd, royriojas, 17/08/2015 17:05:11

v4.2.10

  • Build Scripts Changes
    • fix glob expansion when including excluded paths - 4aefc18, royriojas, 15/08/2015 03:59:53

v4.2.9

  • Bug Fixes
    • Update esformatter-jsx to fix the issue with ObjectExpression and ArrayExpression inside a JSXContainerExpression - 6746cb0, royriojas, 12/08/2015 03:10:23

v4.2.8

  • Build Scripts Changes
    • update clix dep to get nicer log output - d2be874, royriojas, 11/08/2015 19:39:04

v4.2.7

  • Build Scripts Changes
  • Tests Related fixes

v4.2.6

  • Build Scripts Changes

v4.2.5

  • Build Scripts Changes

v4.2.4

  • Build Scripts Changes
    • Update dependencies and build scripts - c004828, royriojas, 07/08/2015 17:04:12

v4.2.3

  • Bug Fixes
    • make sure JSXExpressionContainers are all in the same line - 1db64c3, royriojas, 07/08/2015 13:37:01

v4.2.2

  • Build Scripts Changes
    • make sure tests are only executed once during bump - 7bd29d1, royriojas, 07/08/2015 02:26:21

v4.2.1

v4.2.0

  • Build Scripts Changes
  • Features
    • Add cacheId option to specify an identifier for the cache file to use - bbb9316, royriojas, 05/08/2015 21:13:56

v4.1.0

  • Build Scripts Changes
    • update to latest esformatter and latest esformatter-jsx - a070b94, royriojas, 05/08/2015 03:51:58

v4.0.1

v4.0.0

  • Enhancements
    • Use latest esformatter-jsx for more predictable output - 79511b1, royriojas, 28/07/2015 05:01:18

v3.2.0

  • Features

    • Enable the cache by default - 75b45b8, royriojas, 13/07/2015 00:53:34

      NOTE:

      The cache will work better if the command is executed from the same directory. If different set of files are passed the previous seen ones will be forgotten. Check the package.json for an example of how to use this module locally installed instead of globally installed

v3.1.3

  • Refactoring
    • Allow spaces between Object expression properties - c05b8c8, royriojas, 25/06/2015 04:20:31

v3.1.2

  • Enhancements
    • Make the objects and arrays not inlined if they have nested objects or arrays - 31730fe, royriojas, 24/06/2015 18:39:11

v3.1.1

  • Build Scripts Changes

v3.1.0

  • Features
    • Add esformatter-collapse-objects to keep small objects and arrays collapsed - ea0cd6e, royriojas, 24/06/2015 14:19:21

v3.0.0

  • Tests Related fixes
    • Added initial tests for esbeautifier - ab27ef7, royriojas, 17/06/2015 05:26:15

v2.2.3

v2.1.0

  • Build Scripts Changes

v2.0.5

  • Bug Fixes

v2.0.4

  • Enhancements

v2.0.3

v2.0.2

v2.0.1

  • Lock esprima version to fix the issue with esprima formatting try catches poorly - 9525d1c, [Roy Riojas](https://github.com/Roy Riojas), 10/03/2015 17:06:33