Registry / devops / vp-runtime-helper

vp-runtime-helper

JSON →
library1.0.10jsnpmunverified

vp-runtime-helper v1.0.10 is a Vite plugin development utility providing helper functions for writing Vite plugins. It simplifies common tasks like path manipulation, environment detection, and plugin configuration. Released under the MIT license with TypeScript types included, it targets Vite >=3.1.0 and Node >=14.18.0. Key differentiators: designed specifically for Vite plugin authors, lightweight with zero runtime dependencies, and offers a cohesive set of utilities optimized for Vite's plugin system.

npm install vp-runtime-helper
INSTALL
IMPORT
SIG · VP-RUNTIME-HELPER
V
vp-runtime-helper
devopsjavascriptv1.0.10
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

default
✓ import vprh from 'vp-runtime-helper'
✗ const vprh = require('vp-runtime-helper')
The package provides a default export as the main entry. CommonJS require may not work if your project is ESM-only.
HelperFunction
✓ import { HelperFunction } from 'vp-runtime-helper'
✗ import HelperFunction from 'vp-runtime-helper'
Named exports are also available. TypeScript types are included, so you can use 'import type { HelperFunction } from 'vp-runtime-helper'.
default as vprh
✓ import vprh from 'vp-runtime-helper'
Aliasing the default import is common: `import vprh from 'vp-runtime-helper'`.

Demonstrates how to import and use the default export and two helper functions (resolveAlias, isDev) in a Vite plugin written in TypeScript.

import vprh from 'vp-runtime-helper' import type { Plugin } from 'vite' export default function myPlugin(): Plugin { return { name: 'my-plugin', config(config) { console.log(vprh.resolveAlias(config.resolve?.alias)) if (vprh.isDev(config)) { console.log('Development mode') } return config } } }
Debug
Known issues
gotchaThe package is designed for Vite plugin development; using it outside of a Vite context may cause unexpected behavior.
fix
Ensure you are using this only inside Vite plugins or hooks.
affects: >=1.0.0
gotchaSome helper functions may rely on Vite's internal structures which can change between Vite versions.
fix
Pin the vp-runtime-helper version to a specific one that works with your Vite version, and test after upgrading Vite.
affects: >=1.0.0
deprecatedThe legacy function 'vprh.legacyHelper' is deprecated in v1.0.5 and removed in v1.0.10.
fix
Use the recommended alternative: vprh.newHelper or update to v1.0.10 and adapt your code accordingly.
affects: >=1.0.5 <1.0.10
Errors
Common errors & fixes
Cannot find module 'vp-runtime-helper' or its corresponding type declarations.
The package may not be installed or the project is using TypeScript but missing type declarations for a CommonJS module.
fix
Install the package: npm install vp-runtime-helper. If using TypeScript, ensure 'esModuleInterop' is enabled in tsconfig.json, or use a default import with 'allowSyntheticDefaultImports'.
TypeError: vprh.isDev is not a function
The imported object is not the default export (e.g., using named import incorrectly).
fix
Use the correct default import: import vprh from 'vp-runtime-helper'. Then call vprh.isDev()
Uncaught SyntaxError: The requested module 'vp-runtime-helper' does not provide an export named 'HelperFunction'
Using an incorrect named export name or the import syntax is wrong in a browser context.
fix
Check available exports in the documentation. Use named imports correctly: import { HelperFunction } from 'vp-runtime-helper'. If bundling for browser, ensure the package is compatible and not using Node.js APIs.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
vp-runtime-helper — npm install vp-runtime-helper · libregistry