How to use the xmldom.NodeList function in xmldom

To help you get started, we’ve selected a few xmldom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github semanticlink / howtohypermedia / gatsby-node.js View on Github external
exports.modifyWebpackConfig = function modifyWebpackConfig({config, stage}) {
  config.removeLoader('md')
  config.loader('md', {
    test: /\.md$/,
    loader: 'babel-loader!reactdown/webpack'
  })

  if (stage === 'build-html') {
    const pages = config._config.plugins[0].paths
    config._config.plugins[0] = new StaticSiteGeneratorPlugin({
      entry: `render-page.js`,
      paths: pages,
      globals: {
        DOMParser: xmldom.DOMParser,
        NodeList: xmldom.NodeList,
        atob: function atob(str) {
          return new Buffer(str, 'base64').toString('binary');
        },
        location: {
          pathname: ''
        },
        document: {
          addEventListener: () => null,
          removeEventListener: () => null
        }
      }
    })
  }

  return config
}
github howtographql / howtographql / gatsby-node.js View on Github external
exports.modifyWebpackConfig = function modifyWebpackConfig({config, stage}) {
  config.removeLoader('md')
  config.loader('md', {
    test: /\.md$/,
    loader: 'babel-loader!reactdown/webpack'
  })

  if (stage === 'build-html') {
    const pages = config._config.plugins[0].paths
    config._config.plugins[0] = new StaticSiteGeneratorPlugin({
      entry: `render-page.js`,
      paths: pages,
      globals: {
        DOMParser: xmldom.DOMParser,
        NodeList: xmldom.NodeList,
        atob: function atob(str) {
          return new Buffer(str, 'base64').toString('binary');
        },
        location: {
          pathname: ''
        },
        document: {
          addEventListener: () => null,
          removeEventListener: () => null
        }
      }
    })
  }

  return config
}

xmldom

A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis