Socket
Book a DemoInstallSign in
Socket

hastypes

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hastypes

Does the given package have TypeScript types?

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
2
Created
Source

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

Keywords

npm

FAQs

Package last updated on 30 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts