Skip to content

inspect-js/hastypes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6d1ee7e · Feb 3, 2025

History

12 Commits
Dec 7, 2024
Dec 3, 2024
Dec 3, 2024
Dec 3, 2024
Dec 11, 2024
Dec 3, 2024
Dec 7, 2024
Feb 3, 2025
Dec 3, 2024
Dec 3, 2024
Dec 7, 2024
Dec 11, 2024
Dec 3, 2024
Dec 11, 2024
Dec 3, 2024
Dec 3, 2024

Repository files navigation

hastypes Version Badge

github actions coverage License Downloads

npm badge

Does the given package have TypeScript types?

Inspired by https://github.com/ofrobots/typescript-friendly

Example

$ hastypes hastypes # => integrated
$ hastypes react@19 # => @types/react
$ hastypes mdpdf@1 # => none
import hasTypes from 'hastypes';
import assert from 'assert';

hasTypes('hastypes').then(x => assert.equal(x, true));
hasTypes('react@19').then(x => assert.equal(x, '@types/react'));
hasTypes('mdpdf@1').then(x => assert.equal(x, false));

Tests

Simply clone the repo, npm install, and run npm test