Sort and group imports in node application. This is a CLI interface for bharyang.
Install from npm:
npm install -g bharyang-cliThis CLI is geared towards use from text editor plugins. The import lines are passed to the CLI as stdin stream, and the sorted lines are returned in stdout.
$ echo "
import * as userService from '../../services/user';
import CONST from '../../constans/common';
" | bharyangThe different sorting modes can be provided as arguments:
bharyang --asc
bharyang --desc
bharyang --groupGrouping the imports is the default case.