Registry / devops / volar-service-typescript-twoslash-queries

volar-service-typescript-twoslash-queries

JSON →
library0.0.70jsnpmunverified

This package integrates TypeScript Twoslash query capabilities directly into Volar-powered language services, enhancing developer tooling within Vue and other Volar-supported environments. It allows for inline type information and error checking queries within code comments, similar to how TypeScript's own playground functions. As of version 0.0.70, it is still in a pre-1.0 stage, indicating potential API changes but is actively maintained as part of the Volar ecosystem. Its release cadence is typically tied to Volar's own development cycle, meaning updates often coincide with new Volar releases or when new Twoslash features need integration. Key differentiators include its seamless integration into Volar's Language Server Protocol, providing rich type feedback without needing external tools or complex build steps for ad-hoc type queries directly within your editor.

npm install volar-service-typescript-twoslash-queries
INSTALL
IMPORT
SIG · VOLAR-SERVICE-TYPE
V
volar-service-typescript-twoslash-queries
devopsjavascriptv0.0.70
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.

create
import { create } from 'volar-service-typescript-twoslash-queries';
import volarTwoslashService from 'volar-service-typescript-twoslash-queries';
For ESM environments, 'create' is a named export. Avoid default imports.
create
const { create } = require('volar-service-typescript-twoslash-queries');
const volarTwoslashService = require('volar-service-typescript-twoslash-queries');
For CommonJS environments, 'create' is available as a named property on the module export.

Demonstrates how to integrate the Twoslash queries service into a Volar configuration file.

module.exports = { services: [ require('volar-service-typescript-twoslash-queries').create(), ], };
Debug
Known issues
gotchaThis package is currently in a pre-1.0 version (0.0.70), indicating its API surface may not be stable and could introduce breaking changes in minor versions. Always pin exact versions or review release notes carefully.
fix
Pin exact package versions (e.g., '0.0.70') in your `package.json` and review release notes thoroughly for any updates before upgrading.
affects: <1.0.0
breakingCompatibility with Volar's core language service is crucial. Major updates to `@volar/language-service` (e.g., v2.x to v3.x) often require corresponding updates to `volar-service-typescript-twoslash-queries` due to potential API changes in the Volar ecosystem.
fix
Ensure the installed version of `volar-service-typescript-twoslash-queries` matches the recommended version for your `@volar/language-service` installation. Check the package's `peerDependencies` and Volar's documentation.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'volar-service-typescript-twoslash-queries'
The package is not installed or the `require()`/`import` path is incorrect.
fix
Run `npm install volar-service-typescript-twoslash-queries` or `yarn add volar-service-typescript-twoslash-queries` in your project.
TypeError: require(...).create is not a function
Attempting to call `create` incorrectly, potentially due to a mismatch between CommonJS and ESM module usage, or an incorrect import alias.
fix
For CommonJS, use `require('volar-service-typescript-twoslash-queries').create()`. For ESM, use `import { create } from 'volar-service-typescript-twoslash-queries';` and then call `create()`.
Service 'typescript-twoslash-queries' is not compatible with Volar version X.Y.Z
There is a version mismatch between this service package and your core `@volar/language-service` installation, leading to API incompatibility.
fix
Update `volar-service-typescript-twoslash-queries` to a version that specifically supports your `@volar/language-service` version. Consult the package's `peerDependencies` in `package.json`.
Upgrade
Version history
0.0.70latest on npm
Audit
Dependencies
@volar/language-servicerequiredRequired for Volar's core language service functionality, which this package extends.
Agent activity
17 hits · last 30 days
node
14
Resources
volar-service-typescript-twoslash-queries — npm install volar-service-typescript-twoslash-queries · libregistry