A native NodeJS module to interact with macOS haptic feedback.
npm install node-mac-haptics --save
import haptics from 'node-mac-haptics';
haptics.performFeedback();
haptics.performFeedback(pattern = 'NSHapticFeedbackPatternGeneric', performanceTime = 'NSHapticFeedbackPerformanceTimeNow')
pattern
String - pattern of feedback to be provided to the user. Can be one ofNSHapticFeedbackPatternLevelChange
,NSHapticFeedbackPatternAlignment
, orNSHapticFeedbackPatternGeneric
.performanceTime
String - the time when the feedback should be provided to the user. Can be one ofNSHapticFeedbackPerformanceTimeDefault
,NSHapticFeedbackPerformanceTimeDrawCompleted
, orNSHapticFeedbackPerformanceTimeNow
.
Returns Void
.
Initiates a specific pattern of haptic feedback to the user.
Notes:
- Works from macOS 10.11.