# @types/node-dht-sensor

> TypeScript definitions for node-dht-sensor

Latest version **0.4.2** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/node-dht-sensor
pnpm add @types/node-dht-sensor
yarn add @types/node-dht-sensor
bun add @types/node-dht-sensor
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2023-11-07 |
| First published | 2020-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/node-dht-sensor
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dht-sensor
- npm.io page: https://npm.io/package/@types/node-dht-sensor

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.4.2 (latest) — 2023-11-07
- 0.4.0 (ts3.2) — 2020-10-26
- 0.4.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/node-dht-sensor`

# Summary
This package contains type definitions for node-dht-sensor (https://github.com/momenso/node-dht-sensor).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dht-sensor.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-dht-sensor/index.d.ts)
````ts
/// <reference types="node" />

export type DHT11 = 11;
export type DHT22 = 22;
export type SensorType = DHT11 | DHT22;

export interface SensorData {
    temperature: number;
    humidity: number;
}

export function initialize(type: SensorType, pin: number): boolean;
// for faked test values only
export function initialize(testOptions: { test: { fake: SensorData } }): void;

export function read(
    type: SensorType,
    pin: number,
    callback: (err: NodeJS.ErrnoException | null, temperature: number, humidity: number) => void,
): void;
export function read(type?: SensorType, pin?: number): SensorData;

export function setMaxRetries(maxRetries: number): void;

export namespace promises {
    function initialize(type: SensorType, pin: number): boolean;
    function initialize(testOptions: { test: { fake: SensorData } }): void;
    function readSync(type?: SensorType, pin?: number): SensorData;
    function read(type?: SensorType, pin?: number): Promise<SensorData>;
    function setMaxRetries(maxRetries: number): void;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Manuel Schächinger](https://github.com/schaechinger).

---
_Source: https://npm.io/package/@types/node-dht-sensor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
