Skip to content

clipboard

Access the text from the clipboard.

import { clipboard } from 'miletus';

//Using then()
clipboard.readText().then((text) => {
  console.log('Contents of the clipboard: ' + text);
});

//Using await() in an async function
let text = await clipboard.readText();
console.log('Contents of the clipboard: ' + text);

Methods

readText()

Returns Promise<string> - Resolves with the text that is in the clipboard.

writeText(text)

  • text string - Text to write. Write text to the clipboard.