finds.dev

vueuse/vue-demi

🎩 Creates Universal Library for Vue 2 & 3

View on GitHub

★ 3,129JavaScriptMITupdated Jan 2025

// the take

Vue Demi is a shim layer that lets library authors write a single codebase targeting both Vue 2 and Vue 3 by re-exporting the Composition API from whichever version the consumer has installed. It solves a real problem that existed during the Vue 2→3 migration window. The repo itself now carries a caution banner saying it should not be used for new projects and will be deprecated.

Adopted by serious projects (VueUse, TanStack Query, vue-apollo) which validates the approach works in production. The postinstall hook that auto-detects and switches the target version is clever — consumers don't have to think about it. Provides isVue2/isVue3 flags for the cases where you genuinely need version-specific code paths. The aliasing feature (vue-demi-switch 2 vue2) lets you run your test suite against both versions with npm aliases, which is the right way to do cross-version CI.

This is effectively a deprecated compatibility shim — the repo itself tells you not to use it for new projects. Vue 2 reached end-of-life in December 2023, so the problem this solves is shrinking every month. The postinstall script rewriting files on disk is fragile; it breaks in monorepos, certain CI caching setups, and with package managers that don't run postinstall by default (pnpm with some configs). The lib/ directory contains committed build artifacts, which is a maintenance smell — consumers can get stale binaries if the build isn't kept in sync with the source.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
3,129
Forks
171
Language
JavaScript
License
MIT
Last commit
22 Jan 2025

// nearby

If vue-demi isn't quite it.

All repos →