Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.88k stars 602 forks source link

new release #517

Closed paztis closed 5 years ago

paztis commented 5 years ago

Hi all

Dependencies versions have been updated 1 year ago, but last xml2js release is still 2 years old Is it possible to release it again ?

In last npm release, xmlbuilder is in version ~9.0.1 In last git package.json, xmlbuilder is in version ~10.0.0 and more xmlbuilder is now in version 13.0.2

xmlbuilder adds now the ability to format attributes on multiple lines that is missing in xml2js Is it possible to increase the version and republish it ?

Thanks

paztis commented 5 years ago

or better, to let the ability in the Builder contructor to pass another instance of xmlbuilder. Like this people like me can pass a more recent version of xmlbuilder without forcing you to update your code. I can create a PR for this if needed

knoxcard commented 5 years ago

Exactly...https://github.com/Leonidas-from-XIV/node-xml2js/pull/524

knoxcard commented 5 years ago

@paztis - That would be pretty sweet actually! Just drawing out the code to illustrate to others...

const xml2js = require('xml2js');

// holy moly!  - wouldn't need hard coded dependencies in package.json
xml2js.sax(require('sax'))
xml2js.xmlbuilder(require('xmlbuilder'))

// or something like...
xml2js.dependencies.push(require('sax'))
xml2js.dependencies.push(require('xmlbuilder'))

const xml = '<root>Hello world!</root>'
xml2js.parseString(xml, function (err, result) {
    console.log(result.root); // Output: Hello world!
});

@Leonidas-from-XIV

Leonidas-from-XIV commented 5 years ago

I'll try to make a release this weekend.

Leonidas-from-XIV commented 5 years ago

Just published 0.4.20.

tomhughes commented 5 years ago

Could you tag it on github please?

Leonidas-from-XIV commented 5 years ago

Ah yes, forgot to push the commit. There you go, it is tagged now.

paztis commented 5 years ago

Version of xmlbuilder is not increased to ~13.0.0 in your release ?

Leonidas-from-XIV commented 5 years ago

No, I did not see a reason to do so.

paztis commented 5 years ago

I don't know if multiline attributes formatting is available in 10.0.0. Will check it tomorrow

paztis commented 5 years ago

No it is available since 12.0.1 : https://github.com/oozcitak/xmlbuilder-js/commit/c92ba3e6387ab305e9487b4bee546f249da33f4e

It means my defect is still opened, as there's still no way to pass an upper version.

paztis commented 5 years ago

It is explain in the first post of this topic. That was the reason I ask to increase the dependency version of xmlbuilder.

Currently It is not possible to format a xml with attributes on multiple lines. As I work on big xml with long attributes names, result is not readable.

Xmlbuilder allows since the version 12 to pass a "width" option to limit the width or the lines. As you just pass down the option to xmlbuilder, it works automatically on your module if we're able to move to version 12.0.1 at minimum.

Leonidas-from-XIV commented 5 years ago

https://github.com/Leonidas-from-XIV/node-xml2js/pull/528

Leonidas-from-XIV commented 5 years ago

Released as 0.4.21 just now.

paztis commented 5 years ago

Perfect thanks a lot