1.0.4 • Published 5 years ago

mask-xml v1.0.4

Weekly downloads
552
License
SEE LICENSE IN LI...
Repository
github
Last release
5 years ago

mask-xml

Redacts values in xml. Useful when sending data to external logging services such as Sentry.

Status

npm version npm downloads build status

Installation

Install the package via npm:

$ npm install mask-xml

Usage

Arguments

  1. collection (Array): An array of keys to redact.
  2. [options] (Object): An optional object with the following options:
OptionDefault valueDescription
ignoreCasefalseWhether to ignore case sensitivity when matching keys
replacement--REDACTED--The default value to replace

Returns

(Function): Returns a function that will redact values from a given xml string.

Example

var blacklist = ['password', 'username'];
var maskXml = require('mask-xml')(blacklist);

maskXml(`<xml><password>foo</password><username>bar</username></xml>`);

// => '<xml><password>--REDACTED--</password><username>--REDACTED--</username></xml>'

Tests

$ npm test

Release

npm version [<new version> | major | minor | patch] -m "Release %s"

License

MIT

1.0.4

5 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.2

8 years ago

0.0.1

8 years ago