Registry / devops / typescript-auto-import-cache

typescript-auto-import-cache

JSON →
library0.3.6jsnpmunverified

typescript-auto-import-cache is a utility package within the Volar.js ecosystem, currently at version 0.3.6, designed to address the performance bottleneck in the TypeScript Language Service Completion API, specifically when calculating auto-imports. It achieves this by porting and optimizing the `tsserver`'s internal auto-import caching logic. This package functions as a TypeScript Language Service Plugin, meaning it extends the functionality of the TypeScript language server (`tsserver`) to enhance the developer experience in IDEs (like VS Code) by speeding up IntelliSense for auto-imports. It is primarily a tooling-oriented package, not intended for direct runtime use in application code, and typically sees updates aligned with new TypeScript versions or Volar.js releases that may impact language service performance. Its key differentiator is its focused approach to optimizing a common pain point in large TypeScript projects, directly integrating with the underlying language service architecture.

npm install typescript-auto-import-cache
INSTALL
IMPORT
SIG · TYPESCRIPT-AUTO-IM
T
typescript-auto-import-cache
devopsjavascriptv0.3.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TypeScript Language Service Plugin
This package is not imported directly into user application code. It's configured via `tsconfig.json` as a plugin.
import { enableAutoImportCache } from 'typescript-auto-import-cache'; // Incorrect usage in application code. const plugin = require('typescript-auto-import-cache'); // Incorrect CommonJS require for direct use.
typescript-auto-import-cache is a TypeScript Language Service Plugin. Its exports are consumed by the TypeScript language server itself (tsserver), not by typical application code. Developers enable it by referencing its package name in the `plugins` array within `tsconfig.json`. Attempts to `import` or `require` it directly into your own source files for runtime execution will not yield the intended results, as its functionality is specific to the IDE's language features.

This `tsconfig.json` configuration snippet demonstrates how to enable the `typescript-auto-import-cache` as a plugin for the TypeScript Language Service.

{ "compilerOptions": { "plugins": [ { "name": "typescript-auto-import-cache" } ], "target": "es2020", "module": "esnext", "lib": ["es2020", "dom"], "jsx": "react-jsx", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "allowJs": true }, "include": ["src"], "references": [{ "path": "./tsconfig.node.json" }] }
Debug
Known issues
breakingAs a `0.x.y` version package, `typescript-auto-import-cache` may introduce breaking changes without adhering to semantic versioning for major versions. Updates should be tested carefully.
fix
Always review the package's GitHub repository or `CHANGELOG.md` for specific migration steps when updating minor or patch versions of `0.x` releases.
affects: >=0.1.0
gotchaLanguage Service Plugins are sensitive to the TypeScript version used by your editor/IDE. Incompatibility between the plugin's expected TypeScript version and the project's or editor's TypeScript version can lead to the plugin failing to load or unexpected behavior.
fix
Ensure your editor is using the workspace version of TypeScript (e.g., via `"typescript.tsdk": "node_modules/typescript/lib"` in VS Code settings). Consult plugin documentation for any specific TypeScript version requirements.
affects: >=0.1.0
gotchaThis package is a performance optimization for the TypeScript Language Service (tsserver), meaning its impact is primarily on IDE responsiveness for auto-imports, not on the `tsc` compilation speed or runtime performance of your application.
fix
Do not expect changes in build times or application execution. If you observe no IDE performance improvement, verify the plugin is correctly loaded and there aren't other performance bottlenecks in your project configuration or editor setup. Check TypeScript server logs for plugin load status.
affects: >=0.1.0
gotchaIncorrect `tsconfig.json` paths or plugin configuration (e.g., typos in the plugin name) will cause the plugin to not load silently or with generic errors in the TypeScript server logs, leading to no performance benefits.
fix
Double-check the `name` property in `compilerOptions.plugins`. Enable verbose TypeScript server logging in your editor (e.g., `"typescript.tsserver.log": "verbose"` in VS Code) to diagnose plugin loading issues.
affects: >=0.1.0
Errors
Common errors & fixes
Plugin 'typescript-auto-import-cache' failed to load. Its 'create' function did not return a language service.
The plugin's factory function either threw an error during initialization or returned an invalid object that didn't conform to the Language Service Plugin interface, often due to an incompatible TypeScript version or internal plugin issue.
fix
Ensure your project's `typescript` dependency is compatible with the `typescript-auto-import-cache` plugin. Try updating `typescript-auto-import-cache` to the latest version. Check editor settings to confirm the workspace TypeScript version is being used. Refer to the plugin's GitHub issues for known compatibility problems.
Error: Cannot find module 'typescript-auto-import-cache' from '.../tsserver'
The TypeScript language server (tsserver) could not locate the `typescript-auto-import-cache` package in `node_modules`. This typically happens if the package isn't installed or if `tsserver` is resolving modules from an unexpected location.
fix
Run `npm install typescript-auto-import-cache` or `yarn add typescript-auto-import-cache`. Ensure your editor is configured to use the workspace TypeScript version, which will instruct `tsserver` to look in your project's `node_modules` for plugins.
Upgrade
Version history
0.3.6latest on npm
Audit
Dependencies
typescriptrequiredRequired as a peer dependency for TypeScript Language Service Plugins to ensure compatibility with the `tsserver` version being used by the editor.
Agent activity
4 hits · last 30 days
node
4
Resources