diff --git a/LICENSE b/LICENSE index 28b641e..fdec57f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Tuan Anh Tran https://tuananh.org +Copyright (c) 2018 Tuan Anh Tran https://tuananh.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a5cfffa..ebe3cfa 100644 --- a/README.md +++ b/README.md @@ -30,19 +30,22 @@ xml-js x 28.51 ops/sec ±8.18% (53 runs sampled) libxmljs x 107 ops/sec ±18.57% (48 runs sampled) ``` -* Please note that this is an unfair game for camaro because it only transform what it needs. +* Please note that **this is an unfair game for camaro** because it only transform those fields specified in template. The whole reason of me creating this is because most of the time, I'm just interested in some of the data in the whole XML mess. * Benchmark run with Intel Core i5-5257U CPU @ 2.70GHz using Node v7.10.0 * I may expose another method to transform the whole XML tree so that the benchmark will better reflect the real performance. +* Performance on small XML strings is not very good due to crossing between JS and C++ is expensive. + ![intro](intro.png) ## Installation ```sh -npm install camaro +yarn add camaro +# npm install camaro ``` ## Usage @@ -98,24 +101,4 @@ As of currently, AWS Lambda only supports node 6 on Linux so you're looking for ## Licence -The MIT License - -Copyright (c) 2017 Tuan Anh Tran https://tuananh.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +[The MIT License](LICENSE) \ No newline at end of file diff --git a/index.js b/index.js index 62c695b..4048815 100644 --- a/index.js +++ b/index.js @@ -30,8 +30,8 @@ function transform(xml, template) { throw new TypeError('2nd argument (template) must be an object') } - const template_string = JSON.stringify(template) - let result = camaro.transform(xml, template_string) + const templateString = JSON.stringify(template) + let result = camaro.transform(xml, templateString) if (isEmptyObject(result)) { throw new TypeError('Invalid input: Malformed xml') diff --git a/package-lock.json b/package-lock.json index 5af4938..e70a801 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "camaro", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ee33e0f..158d00a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "camaro", - "version": "3.0.0", + "version": "3.0.1", "description": "Transforming XML to JSON using Node.js binding to native pugixml parser library", "homepage": "https://github.com/tuananh/camaro", "bugs": "https://github.com/tuananh/camaro/issues", diff --git a/src/pugixml b/src/pugixml index 3061cb4..e6d8e35 160000 --- a/src/pugixml +++ b/src/pugixml @@ -1 +1 @@ -Subproject commit 3061cb4a87bad27b30d0115cb598b71dab1986cc +Subproject commit e6d8e3538af9bfa838107f073287a8238904e020