Skip to content
PluginStats

prettier-plugin-shorten-imports weekly downloads statistics

By porky-prince · npm · Prettier plugins

Prettier plugin that shortens local import paths

View on npm Fresh · Oct 18, 2026

prettier-plugin-shorten-imports has 3 recorded weekly downloads on npm, a decrease of 57.1% over the past 30 days, ranking #2250 of 2,322 tracked listings.

Weekly downloads
3
Official API · Oct 18, 2026
7-day growth
—
Insufficient history
30-day growth
-57.1%
-4 weekly downloads
90-day growth
-25.0%
-1 weekly downloads
Rank
#2250
Among tracked npm listings

About prettier-plugin-shorten-imports

prettier-plugin-shorten-imports

This plugin rewrites local import and export specifiers to the shortest path depth based on your tsconfig.json or jsconfig.json paths mappings. You can use it to keep imports consistent and avoid long relative paths.

Features

This section summarizes what the plugin does when Prettier formats a file.

  • Supports .js, .jsx, .ts, .tsx, and .vue files.
  • Rewrites only static import and export ... from specifiers.
  • Compares relative paths and paths aliases and keeps the shortest depth.
  • Preserves existing file extensions and normalizes to POSIX separators.
  • Skips specifiers that resolve to node_modules or outside the project root.

Installation

Use your package manager to add the plugin as a development dependency.

pnpm add -D prettier-plugin-shorten-imports

Usage

You must register the plugin with Prettier before formatting your files.

prettier --plugin=prettier-plugin-shorten-imports --write "src/**/*.{ts,tsx}"

If you use a Prettier config file, add the plugin to the plugins list:

{
  "plugins": ["prettier-plugin-shorten-imports"]
}

Configuration

The plugin reads the nearest tsconfig.json or jsconfig.json from the current file location. It uses compilerOptions.paths and baseUrl from the nearest config to resolve aliases, and it merges baseUrl and paths through nested extends chains with the nearest config taking precedence.

If paths exist but baseUrl is missing, the plugin treats the config file directory as the baseUrl root. If no paths are defined, the plugin does not change specifiers.

Behavior

This section lists key rules that influence how specifiers are rewritten.

  • The plugin keeps the original specifier when depth and string length tie.
  • For .vue files, it only updates <script> and <script setup> blocks.
  • It does not change <script src="..."> external scripts.
  • It does not touch dynamic import() or require() calls.

Example

This example shows an alias winning over a deeper relative path.

tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@app/*": ["src/*"]
    }
  }
}

Input:

import { formatName } from "../../utils/format";

Output:

import { formatName } from "@app/utils/format";

Description from the npm listing.

  • prettier
  • prettier-plugin
  • shorten
  • imports
  • paths

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-shorten-imports weekly downloads on npm, last 90 days: 3 weekly downloads as of Oct 18, 2026, -25.0% over 90 days.prettier-plugin-shorten-importsWeekly downloads on npm · Last 90 days3downloads / week-25.0% over 90 days02468101214Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-shorten-imports weekly downloads on npm, last 90 days: 3 weekly downloads as of Oct 18, 2026, -25.0% over 90 days.

7/30/90-day growth

prettier-plugin-shorten-imports weekly downloads growth on npm: 7-day growth unavailable, -57.1% over 30 days, -25.0% over 90 days.prettier-plugin-shorten-importsWeekly downloads growth on npm3downloads / week now7-day growth+3 weekly downloadsInsufficient history30-day growth-4 weekly downloads-57.1%90-day growth-1 weekly downloads-25.0%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-shorten-imports weekly downloads growth on npm: 7-day growth unavailable, -57.1% over 30 days, -25.0% over 90 days.

Ranking history

prettier-plugin-shorten-imports npm ranking history: currently #2250 (by weekly downloads).prettier-plugin-shorten-importsnpm ranking · by weekly downloads · Last 90 days#2250current rank#2200#2210#2220#2230#2240#2250#2260Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-shorten-imports npm ranking history: currently #2250 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 113, #14 (overall #2,254)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 10, #16 (overall #196)
Prettier plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for prettier-plugin-shorten-imports
Date (UTC)Weekly downloadsChange vs. previous
3+2
10
10
10
10
10
1+1
00
00
0-1
10
10
10
1—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-shorten-imports alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/prettier-plugin-shorten-imports. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.