node-mac-haptics
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Node macOS Haptics

A native NodeJS module to interact with macOS haptic feedback.

Installation

npm install node-mac-haptics --save

Usage

import haptics from 'node-mac-haptics';

haptics.performFeedback();

API

haptics.performFeedback(pattern = 'NSHapticFeedbackPatternGeneric', performanceTime = 'NSHapticFeedbackPerformanceTimeNow')

  • pattern String - pattern of feedback to be provided to the user. Can be one of NSHapticFeedbackPatternLevelChange, NSHapticFeedbackPatternAlignment, or NSHapticFeedbackPatternGeneric.
  • performanceTime String - the time when the feedback should be provided to the user. Can be one of NSHapticFeedbackPerformanceTimeDefault, NSHapticFeedbackPerformanceTimeDrawCompleted, or NSHapticFeedbackPerformanceTimeNow.

Returns Void.

Initiates a specific pattern of haptic feedback to the user.

Notes:

  • Works from macOS 10.11.

License

MIT

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i node-mac-haptics

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.42 kB

    Total Files

    7

    Last publish

    Collaborators

    • martynaskre