
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
js-import-sort
Advanced tools
A JS codemod to sort imports
##Intro Built on top of facebook/jscodeshift
This will transform a JS file, sorting and organising its imports (ES2015/ES6).
Example:
import Main from 'aaaa';
import {ZMain} from 'aaaa';
import First from 'zzz';
import {Third} from 'zzz';
import {Second} from 'zzz';
import * as someDefault from 'bbb';
import {a as b} from 'packageModule';
import SomeClass from './MyModule';
import AnotherClass from '../../Module1';
import * as util from 'util';
Becomes:
import * as util from 'util';
import Main, {ZMain} from 'aaaa';
import * as someDefault from 'bbb';
import First, {Second, Third} from 'zzz';
import {a as b} from 'packageModule';
import AnotherClass from '../../Module1';
import SomeClass from './MyModule';
Imports are separated by node, dependencies in package.json
, other, and relative imports.
##Running To run, just run:
js-import-sort --path ./*
js-import-sort
supports 3 of the debugging tools from jscodesift, dry
, print
and verbose
which can be used in any combination
use --dry
and --print
to view the results of the changes before they are applied
FAQs
A jS Codemode to sort/organise imports
The npm package js-import-sort receives a total of 96 weekly downloads. As such, js-import-sort popularity was classified as not popular.
We found that js-import-sort 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.