Mavis is a thorough JavaScript type-checking library that returns precise string labels for values, surpassing typeof. Current stable version is 2.0.0 (last released in 2016). It has minimal dependencies and works in both Node.js and browsers. Unlike constructor-based checkers, Mavis uses strings for forward/backward compatibility. It distinguishes between arrays, objects, functions, generators, numbers, strings, errors, HTML elements, and more. Includes a type.is() method for comparisons and array-of-types matching. The library is very lightweight but no longer actively maintained.
npm install mavisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic type detection for common values and the type.is comparison method.
Consider using alternatives like 'kind-of' or 'which-typed-array' for continued support.
Use instanceof or constructor.name if you need the specific type.
For cross-realm type checking, consider using 'kind-of' or similar.
Check Symbol support before relying on symbol detection.
Use import mavis from 'mavis' or const mavis = require('mavis').Ensure you have the default export: import m from 'mavis'; then use m.is().
Make sure your argument is not undefined; mavis() expects a value.
No dependency data recorded yet.