Clipboard

Description

Represents the clipboard used for copying and pasting in Atom.

An instance of this class is always available as the atom.clipboard global.

Examples
atom.clipboard.write('hello')

console.log(atom.clipboard.read()) # 'hello'

API documentation

All methods

::write(text, metadata)

Write the given text to the clipboard.

The metadata associated with the text is available by calling Clipboard::readWithMetadata.

Argument Description
text

The String to store.

metadata optional

The additional info to associate with the text.

::read()

Read the text from the clipboard.

Return values

::readWithMetadata()

Read the text from the clipboard and return both the text and the associated metadata.

Return values
  • Returns an Object with the following keys: