Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
muxml
Advanced tools
Readme
Streaming XML parser and formatter
muxml
is a Transform stream that accepts XML strings, and emits small chunks containing individual XML elements.
The parser part of this module is built on sax
:saxophone:.
On parsing, the stream is broken-up and reassembled so that each opening/closing tag and each text is a chunk. During this process, sax events are re-emitted and are listenable down the pipeline.
Once XML is parsed, this module can optionally format XML in the following fashions:
CDATA
<?xml foo="blerg" ?>
) tags<!DOCTYPE
declarationsmuxml
is written with ES6/ES2015 syntax, although it is also shipped as an ES5 module with UMD syntax, meaning it can also be used:
Also available as a gulp / Grunt plugin, or as a CLI app.
$ npm install --save muxml
Suppose a file named example.xml
containing the follwing XML
<a id="foo">
<b>
<c>d</c>
</b>
</a>
then, muxml()
returns a transform stream that accepts XML strings and emits XML elements as strings
const muxml = require('muxml');
fs.createReadStream('example.xml')
.pipe(muxml({pretty: false}))
.on('data', function (data) {
console.log(data);
//=> '<b><c>d</c></b>'
});
Type: boolean
Default: true
Set sax
parser strict
argument
Type: boolean
Default: true
Prettify the output. If true, output has newlines and indentation.
Type: string
Default: spaces
When pretty
is set to true, indent with either spaces
or tabs
.
Type: integer
Default: 2
When pretty
is set to true and indentStyle
is set to spaces
, then indent with this number of spaces.
Type: integer
Default: 1
When pretty
is set to true and indentStyle
is set to tabs
, then indent with this number of tabs.
Type: string
Default: null
a filter for tag names
Filter XML with tags with name matching the filter.
Type: boolean
Default: false
Strip attributes from tags.
Type: boolean
Default: true
Strip CDATA
tags.
Type: boolean
Default: true
Strip XML comments.
Type: boolean
Default: true
Strip <!DOCTYPE
declarations.
Type: boolean
Default: true
Strip processing instruction (like <?xml foo="blerg" ?>
) tags.
Type: object
Default: {}
Set options of sax
parser. Note that trim
can not be set to false
.
Type: object
as described above
gulp
pluginGrunt
pluginMIT © t1st3
FAQs
Streaming XML parser and formatter
The npm package muxml receives a total of 32 weekly downloads. As such, muxml popularity was classified as not popular.
We found that muxml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.