{"_id":"@bladedancer/api-builder-plugin-gm-mustache","_rev":"1-d6b409571dc4b9fc07cf2d1f661f5c56","name":"@bladedancer/api-builder-plugin-gm-mustache","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bladedancer/api-builder-plugin-gm-mustache","version":"1.0.0","description":"Node for templating using mustache","author":"","license":"ISC","keywords":["amplify","api-builder","flow","sdk"],"engines":{"node":">= 8.9"},"main":"src/index.js","dependencies":{"axway-flow-sdk":"^2.0.0","mustache":"^2.3.0"},"peerDependencies":{"@axway/api-builder-runtime":"^4.0.0"},"devDependencies":{"chai":"^4.1.2","check-node-version":"^3.2.0","cross-env":"^5.0.5","eslint":"^4.15.0","eslint-config-axway":"^2.0.7","eslint-plugin-chai-friendly":"^0.4.1","eslint-plugin-mocha":"^4.11.0","mocha":"^5.2.0","nyc":"^11.2.1","rimraf":"^2.6.2"},"scripts":{"build":"check-node-version --package && npm run build:lint && npm run test","build:lint":"eslint .","test":"rimraf coverage .nyc_output && cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary node_modules/mocha/bin/mocha ./test --recursive -R spec","test:debug":"mocha --inspect --debug-brk"},"_id":"@bladedancer/api-builder-plugin-gm-mustache@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.9.3","_npmUser":{"name":"bladedancer","email":"bladedancer.gavin@gmail.com"},"dist":{"integrity":"sha512-vyj6HiS/hzArfsaU2msKu6Lv6PvgGgwh+KaIq8j8UkQ/M9OkCbXac+JEvt+Aa2YSSwDnMHG4FYoY6jNO1/A5ag==","shasum":"8943b306f20271d9e649234f0abd17a80c179d8d","tarball":"https://registry.npmjs.org/@bladedancer/api-builder-plugin-gm-mustache/-/api-builder-plugin-gm-mustache-1.0.0.tgz","fileCount":5,"unpackedSize":9781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyeE/CRA9TVsSAnZWagAAOu4P/1qIrspcEbRBTw/C2r9z\noEbAtXUCo8ouyV/YDKj/7Nd02OeyV8NSysL9uwaSIHCQrJeRP5E7uSHzH9MB\npPDwiZ6LcJ1IToSDl0PIddxYki3IauMN7keYsXDr7yBUPg0DwPKbvt+NOB/P\ntj1ShllDmTFNa8sGtr04LVSQ3lHZU/8/DhQnwj1BCkK2V/8UmCj9z08NUwbY\nZ964tZlQBvFMiwQBSrj0/ETm0hQZ6PRHqbUrbUZupPZunMs72wHbGvIguk1s\nCIju9SKmWxi/EIbYCNt1yhJEd7XaTcuPnsCwuipujk4co9L6Wjd/iubOKckx\nVtaR270W/I6x/PtIjQkrCaN8WG+Nrimhi5TVUBM9/HPDBXn6uKnRYONfmd/H\nMhWeYz82PpCA591Zrti2h93mBV86eT34mUg9nogoO96debI+QydAJZ9/g8J5\nZL/Yw+/NqN54YXUU05iQkHW2zbWgRTxnknLiXBIqNsN2HSzEgqVCE/quqJdp\n6u3OKcJXiwfdrEwahCE88kLjCoqe8eYfaFR8Juw7xjNHbeE++5wt4wXNwaWI\nxcAELL0l26xJPV0ZMjlrJ1mkLCMW+j7SfyCHXP6m6atUMy8UzFpaVeXWf35U\nxwNfM1SyZKRj+H5MrhQA1eFwPKRtM6vGR4Se2xb6CuZ3PUFkwUIkZ0JBl/TA\nvM5Z\r\n=umdv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH2DzAtG3vjp5Cz3TDCTXbQ7xLenTZrsSg10ku/vPWB6AiAyd2QlCOB3qYyXXIqHB1fVmOWP4aGLPWE/5sV+8jV0Jw=="}]},"maintainers":[{"name":"bladedancer","email":"bladedancer.gavin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-builder-plugin-gm-mustache_1.0.0_1539957055110_0.39963004921058776"},"_hasShrinkwrap":false}},"time":{"created":"2018-10-19T13:50:54.897Z","1.0.0":"2018-10-19T13:50:55.214Z","modified":"2022-04-04T19:23:18.882Z"},"maintainers":[{"name":"bladedancer","email":"bladedancer.gavin@gmail.com"}],"description":"Node for templating using mustache","keywords":["amplify","api-builder","flow","sdk"],"license":"ISC","readme":"# api-builder-plugin-gm-mustache\n\n## About\n\nThis module installs the [Mustache](http://mustache.github.io) flow-node to be used within [Axway API Builder's](https://www.axway.com/en/datasheet/axway-api-builder)\nflow editor.\n\nThe Mustache flow-node allows the evaluation of [Mustache](http://mustache.github.io) templates using values from the flow.\n\n### Format string\nThe _Format string_ method evaluates the template given with the data supplied. This allows complex values to be constructed from values that exist in the flow's context.\n\n| Param | Type | Required | Description |\n| --- | --- | --- | --- |\n| data | object | y | The data to evaluate the template with. Use $ to access the entire context. |\n| template | string | y | The template being evaluated. |\n\n### Format object\nThe _Format object_ method is similar to the _Format string_ method. It evaluates the template given with the data supplied. However the resulting string value is then JSON parsed. This allows the creation of JavaScript values and objects from the evaluated template.\n\n| Param | Type | Required | Description |\n| --- | --- | --- | --- |\n| data | object | y | The data to evaluate the template with. Use $ to access the entire context. |\n| template | string | y | The doT template being evaluated. |\n\n### Mustache Templates\nThe Javascript implementation of Mustache being used is https://github.com/janl/mustache.js.\n\n\n#### Example\nIn the examples the Flow is going to be attached to an API that has three parameters, firstname, lastname and gender.\n\n##### Basic interpolation {{ }}\nThe template can be used to quickly concatenate values.\n\n| | |\n| - | - |\n| Request | <http://localhost:8080/api/example?firstname=Clark&lastname=Kent&gender=m> |\n| _data_ | $.params |\n| _template_ | {{firstname}} {{lastname}} |\n| Output | Clark Kent |\n\n\n##### Conditionals {{^value}}{{/value}}\nThe template evaluation supports boolean checkes to tailor the output based on the input.\n\n| | |\n| - | - |\n| Request | <http://localhost:8080/api/example?firstname=Clark&lastname=Kent&male=true> |\n| _data_ | $ |\n| _template_ | Hello {{#male}}Mr{{/male}}{{^male}}Ms{{/male}} {{surname}} |\n| Output | Hello Mr Kent |\n\n| | |\n| - | - |\n| Request | <http://localhost:8080/api/example?firstname=Lois&lastname=Lane> |\n| _data_ | $.params |\n| _template_ | Hello {{#male}}Mr{{/male}}{{^male}}Ms{{/male}} {{surname}} |\n| Output | Hello Ms Lane |\n\n\n##### Array Iteration {{# }}\nThe template engine can also iterate over arrays, creating content for each element in the array.\n\n\n| | |\n| - | - |\n| Request | <http://localhost:8080/api/example?names=Tom,Dick,Harry> |\n| _data_ | $.params |\n| _template_ | {{#names}}{{.}} {{/names}} |\n| Output | Tom Dick Harry  |\n\n\n## Getting started\n\n1.  Go to [platform.axway.com](https://platform.axway.com) and create an account\n1.  Install [API Builder](https://docs.axway.com/bundle/API_Builder_allOS_en/page/api_builder.html)\n1.  Follow the [Getting Started Guide](https://docs.axway.com/bundle/API_Builder_allOS_en/page/api_builder_getting_started_guide.html)\n\n## Install\n\nAfter creating your API Builder project (`appc new -t arrow`), you can install this flow-node handler\nusing npm:\n\n```\nnpm install --save api-builder-plugin-gm-mustache\n```\n\nThe \"Mustache\" flow-node will then be available in the tools panel when creating or editing Flows.\n","readmeFilename":"README.md"}