
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
bluetooth-heart-rate
Advanced tools
A JavaScript library to connect to Bluetooth Heart Rate sensors. This library provides a simple API to connect to heart rate devices that support the standard Bluetooth Heart Rate Measurement characteristic.
You can install the bluetooth-heart-rate
library using npm:
npm install bluetooth-heart-rate
First, you need to connect to a device using the connect function. This will prompt the user to select a device and return a promise that resolves when the connection is established.
import { connect } from 'bluetooth-heart-rate';
connect().then(() => {
console.log('Connected to heart rate sensor.');
});
Once connected, you can start receiving heart rate measurements using the startHeartRateMeasurement function. This function takes a callback that will be called with the heart rate value and an optional interval in seconds to throttle the updates.
import { startHeartRateMeasurement } from 'bluetooth-heart-rate';
startHeartRateMeasurement((heartRate) => {
console.log(`Heart rate: ${heartRate}`);
}, 1); // updates every second
You can stop receiving heart rate updates using the stopHeartRateMeasurement function.
import { stopHeartRateMeasurement } from 'bluetooth-heart-rate';
stopHeartRateMeasurement();
console.log('Stopped heart rate measurement.');
We use Github to host code, to track issues and feature requests, as well as accept pull requests. You can contribute in many ways, and here are a few methods:
Reporting Bugs: If you encounter any bugs or issues, please create a new issue in our Github repository. Provide as much detail as you can about the issue. Screenshots, code snippets, and detailed explanations are all helpful.
Suggest Enhancements: If you have ideas for new features or improvements, we'd love to hear them! Please create a new issue and use the feature request template to share your ideas.
Pull Requests: If you'd like to contribute code, the best way is by making a pull request. If you're new to Github, here is a tutorial on how to create a pull request. Before creating a pull request, please make sure your code follows our coding conventions and passes all tests.
In all cases, after your contribution is reviewed and approved, it will be incorporated into the project!
In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.
We use GitHub issues to track public bugs. Report a bug by opening a new issue; it's that easy!
Great Bug Reports tend to have:
We hope you'll find these guidelines helpful. We're excited to see what you'll contribute!
FAQs
A library to connect to Bluetooth Heart Rate sensors
The npm package bluetooth-heart-rate receives a total of 1 weekly downloads. As such, bluetooth-heart-rate popularity was classified as not popular.
We found that bluetooth-heart-rate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.