New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pull-dom-mutants

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-dom-mutants

[pull-stream](http://pull-stream.github.io/) source of mutations to a dom element using [Mutation Observer](https://developer.mozilla.org/en/docs/Web/API/MutationObserver). Emits [Mutation Records](https://developer.mozilla.org/en-US/docs/Web/API/Mutation

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

pull-dom-mutants

pull-stream source of mutations to a dom element using Mutation Observer. Emits Mutation Records

Example

var pullMutants = require('pull-dom-mutants')
var pull = require('pull-stream')
var test = require('tape')

test('emitter emits a value when child element appended', function (t) {
  var elem = document.createElement('main')
  var child = document.createElement('h1')
  pull(
    pullMutants(elem, {childList: true}),
    pull.take(1),
    pull.drain(function (mutation) {
      var addedChild = mutation.target.querySelector('h1')
      t.equal(addedChild, child)
      t.end()
      window.close()
    })
  )

  t.false(elem.querySelector('h1'))
  elem.appendChild(child)
})

API

  pullMutants(elem [, opts])

Where opts are the options to pass along to Mutation Observer, defaults to {childList: true}

FAQs

Package last updated on 02 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts