Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
module-grouping-cli
Advanced tools
A simple cli tool for sorting imported modules without configuration based on [import-sort](https://www.npmjs.com/package/import-sort) and [import-sort-style-module-grouping](https://www.npmjs.com/package/import-sort-style-module-grouping)
A simple cli tool for sorting imported modules without configuration based on import-sort and import-sort-style-module-grouping
Running this package will groups the es6 imports based on the following order:
When a file imports packages in the following order:
import React from 'react';
import Redux from 'redux';
import type {Node} from 'react';
import theme from 'mdc/index.scss';
import css from './button.module.css';
import css from './dropdown.module.css';
import {ReactComponent} from './logo.svg';
import Button from './button';
import DropDown from './dropdown';
The result will be:
import React from 'react';
import Redux from 'redux';
import theme from 'mdc/index.scss';
import type {Node} from 'react';
import Button from './button';
import DropDown from './dropdown';
import css from './button.module.css';
import css from './dropdown.module.css';
import {ReactComponent} from './logo.svg';
yarn add lint-staged husky --dev
// OR
npm install --save-dev lint-staged husky
// package.json
{
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"module-grouping --write",
"git add"
],
"yarn.lock": [
"git rm --cached"
]
}
}
yarn install module-grouping-cli --dev
Or
npm onstall module-grouping-cli --save-dev
Running the following command will display the result of changes after sorting ES2015 imports:
npx module-grouping-cli **/*.js
Use --write
to update files in-place
npx module-grouping-cli **/*.js --write
Installing and running this command it is exactly the same as installing these dependencies and running this configuration for import-sort.
FAQs
A simple cli tool for sorting imported modules without configuration based on [import-sort](https://www.npmjs.com/package/import-sort) and [import-sort-style-module-grouping](https://www.npmjs.com/package/import-sort-style-module-grouping)
The npm package module-grouping-cli receives a total of 2 weekly downloads. As such, module-grouping-cli popularity was classified as not popular.
We found that module-grouping-cli 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.