{"id":15797269,"url":"https://github.com/fivdi/hts221-sensor","last_synced_at":"2026-04-16T14:02:30.918Z","repository":{"id":57268043,"uuid":"143559693","full_name":"fivdi/hts221-sensor","owner":"fivdi","description":"HTS221 I2C humidity and temperature sensor module for Node.js","archived":false,"fork":false,"pushed_at":"2021-11-07T09:07:05.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T20:47:33.700Z","etag":null,"topics":["beaglebone","beaglebone-black","hts221","humidity","i2c","iot","javascript","nodejs","raspberry-pi","sensor","temperature"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivdi.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-04T20:07:42.000Z","updated_at":"2021-11-07T09:07:08.000Z","dependencies_parsed_at":"2022-09-02T02:50:12.253Z","dependency_job_id":null,"html_url":"https://github.com/fivdi/hts221-sensor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Fhts221-sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Fhts221-sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Fhts221-sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivdi%2Fhts221-sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivdi","download_url":"https://codeload.github.com/fivdi/hts221-sensor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246531984,"owners_count":20792735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beaglebone","beaglebone-black","hts221","humidity","i2c","iot","javascript","nodejs","raspberry-pi","sensor","temperature"],"created_at":"2024-10-05T00:05:58.530Z","updated_at":"2025-10-12T11:32:29.443Z","avatar_url":"https://github.com/fivdi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://app.travis-ci.com/fivdi/hts221-sensor.svg?branch=master)](https://app.travis-ci.com/github/fivdi/hts221-sensor)\n[![npm Version](http://img.shields.io/npm/v/hts221-sensor.svg)](https://www.npmjs.com/package/hts221-sensor)\n[![Downloads Per Month](http://img.shields.io/npm/dm/hts221-sensor.svg)](https://www.npmjs.com/package/hts221-sensor)\n\n# hts221-sensor\n\nHTS221 I2C temperature and humidity sensor module for Node.js on Linux boards\nlike the Raspberry Pi or BeagleBone.\n\nSupports Node.js versions 10, 12, 14, 16 and 17.\n\n## Contents\n\n * [Features](#features)\n * [Installation](#installation)\n * [Usage](#usage)\n   * [Report Temperature and Humidity](#report-temperature-and-humidity)\n   * [Report Temperature and Humidity Continuously](#report-temperature-and-humidity-continuously)\n * [API](#api)\n * [Related Packages](#related-packages)\n\n## Features\n\n * Simple temperature and humidity sensing\n * Promise based asynchronous API\n\n## Installation\n\n```\nnpm install hts221-sensor\n```\n\n## Usage\n\n#### Report Temperature and Humidity\n\n```js\n'use strict';\n\nconst hts221 = require('hts221-sensor');\n\nhts221.open().then(sensor =\u003e\n  sensor.read().\n  then(reading =\u003e {\n    console.log('celsius: ' + reading.celsius);\n    console.log('humidity: ' + reading.humidity);\n  }).\n  then(_ =\u003e sensor.close())\n).catch(console.log);\n```\n\n#### Report Temperature and Humidity Continuously\n\n```js\nconst hts221 = require('hts221-sensor');\n\nhts221.open().then(sensor =\u003e\n  setInterval(_ =\u003e\n    sensor.read().\n    then(reading =\u003e {\n      console.log('celsius: ' + reading.celsius);\n      console.log('humidity: ' + reading.humidity);\n    }).catch(console.log),\n    1000\n  )\n).catch(console.log);\n```\n\n## API\n\n### Functions\n\n- [open([options])](#openoptions)\n\n### Class Hts221\n\n- [close()](#close)\n- [read()](#read)\n\n#### open([options])\nReturns a promise for a Hts221 object.\n\nThe following options are supported:\n- i2cBusNumber - integer, I2C bus number, optional, default 1\n- i2cAddress - integer, Hts221 I2C address, optional, default 0x5f\n\n#### close()\nReturns a promise which will resolve when all resources used by the HTS221\nobject have been freed.\n\n#### read()\nReturns a promise for an object containing a\n[sensor reading](#sensor-reading).\n\n### Sensor Reading\n- celsius - number, temperature in degrees Celsius\n- humidity - number, relative humidity in percent\n\n## Related Packages\n\n- [onoff](https://github.com/fivdi/onoff) - GPIO access and interrupt detection\n- [i2c-bus](https://github.com/fivdi/i2c-bus) - I2C serial bus access\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivdi%2Fhts221-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivdi%2Fhts221-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivdi%2Fhts221-sensor/lists"}