Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xml-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-loader

A webpack module to load XML files.

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Webpack XML loader

A Webpack plugin for loading XML files.

Installation

Install via npm:

npm install --save xml-loader

Usage

You can require XML data like this:

var data = require('xml!./data.xml');
// => returns data.xml content as json-parsed object

var data = require('xml?explicitChildren=true!./data.xml');
// => returns data.xml content as json-parsed object and put child elements to separate properties

The loader will translate the data.xml file into a JSON Object. node-xml2js processors are supported via query syntax.

Usage with webpack.config

To require XML files like this: require('data.xml') , you can add the xml-loader to your webpack config:

module : {
  loaders : [
    { test: /\.xml$/, loader: 'xml-loader' } // will load all .xml files with xml-loader by default
  ]
}

Credits

Keywords

FAQs

Package last updated on 13 Mar 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc