Link Search Menu Expand Document
  • source 1

Configure the processor with information available to all plugins. Information is stored in an in-memory key-value store.

Typically, options can be given to a specific plugin, but sometimes it makes sense to have information shared with several plugins. For example, a list of HTML elements that are self-closing, which is needed during all phases of the process.

  • NOTE: Setting information cannot occur on frozen processors. Call the processor first to create a new unfrozen processor.

Examples

var unified = require('unified')

var processor = unified().data('alpha', 'bravo')

processor.data('alpha') // => 'bravo'

processor.data() // {alpha: 'bravo'}

processor.data({charlie: 'delta'})

processor.data() // {charlie: 'delta'}
  1. https://github.com/unifiedjs/unified#processordatakey-value 


Copyright © 2020 Thence LLC