UNPKG

textwrench-observer

Version:

Cross-platform (Mac/Win) library to get OS-level text selection, process it, and paste automatically.

11 lines (9 loc) 311 B
const { onSelection, paste } = require('..'); // Listen for new selections onSelection(selection => { // Do whatever with selection // You do NOT need to call paste here // Later, in any other part of your app: console.log("Selection changed:", selection); }); paste("my processed string to paste!");