mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add Builder support/options to xml2js
This commit is contained in:
@@ -5,3 +5,13 @@ import xml2js = require('xml2js');
|
||||
xml2js.parseString("<root>Hello xml2js!</root>", (err: any, result: any) => { });
|
||||
|
||||
xml2js.parseString("<root>Hello xml2js!</root>", {trim: true}, (err: any, result: any) => { });
|
||||
|
||||
var builder = new xml2js.Builder({
|
||||
renderOpts: {
|
||||
pretty: false
|
||||
}
|
||||
});
|
||||
|
||||
var outString = builder.buildObject({
|
||||
'hello': 'xml2js!'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user