{"_id":"expander","_rev":"23-51856f7be02c507795d65d380568fdd4","name":"expander","description":"Expand template strings in declarative configurations.","dist-tags":{"latest":"0.3.3"},"versions":{"0.1.0":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.1.0","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"lib/expander","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"grunt-contrib-jshint":"~0.7.1","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.1"},"keywords":["declarative configuration"],"dependencies":{"dotty":"0.0.2","lodash":"~2.2.1"},"_id":"expander@0.1.0","dist":{"shasum":"a938d784dbc60916106d517cd78adb6f1b8b0792","tarball":"https://registry.npmjs.org/expander/-/expander-0.1.0.tgz","integrity":"sha512-OGIFQKYQke3SVxL8hIquNkO2JwHvNad5qBCR2INLvrMOf4Jodg85qWe/ZXvHMl0qEo8A24cjlghdK7fmKhmlYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEyk08O4EHF4boOegr36oPiwdEVP/n6aNLtuVcLlQ/IQIgJiwg6Ou/4PLqaWuCWe2I5UzhnLi5bgP8sTP4VIbL5ls="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}],"directories":{}},"0.2.0":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.2.0","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"lib/expander","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"grunt-contrib-jshint":"~0.7.1","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.1"},"keywords":["declarative configuration"],"dependencies":{"dotty":"0.0.2","lodash":"~2.2.1"},"_id":"expander@0.2.0","dist":{"shasum":"56d3ecdb3e9c8b0fd36a3a602a55bcf069186997","tarball":"https://registry.npmjs.org/expander/-/expander-0.2.0.tgz","integrity":"sha512-+YYq6vfBysuvQ2VSp2vePkO2Qs6L62WwXibLlazx0l0iRN4mgLA4BNPqdLp6Yt2BEzY1VjU+Mlocyviz6y9/Fg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKvCugZOumQn3HXT7qwxoWBMBvEEBxbxFIYAXltklFmgIhANihFegJuphz9bmjnPGB8wP9JrK9l+2OEvs0xY1PUSTS"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.2.1":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.2.1","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"lib/expander","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"grunt-contrib-jshint":"~0.7.1","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.1"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.2.1","dist":{"shasum":"61c89119494f0b0858bd7c470209ac82f9394129","tarball":"https://registry.npmjs.org/expander/-/expander-0.2.1.tgz","integrity":"sha512-DYxisqC0DC4KIvohQ7R19/dphhory48M1HvumvcM8UPso2NeKkAzmZEKmobHLBXseLv5Mc3EjFR3ugE8h3/NXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4so7XqycbFPYatMu31vWfvWFom3S/vLP+EI2VPPrC4AiBjW3PAgagzXvqN/tVaj62B0ZpLU+/CLTV0mMj0pdwPsg=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.2.2":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.2.2","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"lib/expander","engines":{"node":">= 0.8.0"},"scripts":{"test":"grunt"},"devDependencies":{"grunt-contrib-jshint":"~0.7.1","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.1"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.2.2","dist":{"shasum":"1bbbaf491b7955922a18514b704069fc5673e018","tarball":"https://registry.npmjs.org/expander/-/expander-0.2.2.tgz","integrity":"sha512-zduoz/ip71zM/ZHTOLjDGk5L19FPOWk8Nk7x4nDMlqTZfeeCwAmpdp+sFeUp5PvbZH2snMnTBFALZCJFOweEjw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHV+42uOX3+8aRJohJjgWQoYsyMgXeUb2f6S3PVOWzujAiBZIOrdEYyPtuuh98sB0WwL+c7N7/9Qq7BpuSwG8NGu2A=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.3.0":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.3.0","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha -R spec test/index.js"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.9.0"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.3.0","dist":{"shasum":"cb6fb0045f9460abdc9e6464e1832a0f71ad3023","tarball":"https://registry.npmjs.org/expander/-/expander-0.3.0.tgz","integrity":"sha512-U6YMFxrmRFhNGBe13sc7LdPyGDkJjk3CRRuNTlxXiUW3Ep/B8di0tmhieV3iYsGzzQfwVFVkkxhoJW3KgzDE/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKn9p1oHxuSQxmk7kjIJFPxuo2Y2wka2dj1mSBVeNSsQIhAKI0I0JACIHHwmo3R08osRLN8VTHeRXg19IoMZcCNDYz"}]},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.3.1":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.3.1","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha -R spec test/index.js"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.9.0"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.3.1","dist":{"shasum":"5e318899f8ec6fbbadd0d5379ca058ec0cc8defe","tarball":"https://registry.npmjs.org/expander/-/expander-0.3.1.tgz","integrity":"sha512-t2Ug3NM9ivQUI59KCPkchORIcIWPxQQO/mggK+l+rButQnB3/msAQMqIfEuxmV0QrKysZmjKwfwkq5YlmqXaiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDy4itnNevTcZllowodKHP89qYbcPra9BQkNOzlEtOYJAiEA2ROuv7RXlJ8G/51O025xrg1l4/RA0t/Jm1a5rkcFS9c="}]},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.3.2":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.3.2","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha -R spec test/index.js"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.9.0"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.3.2","dist":{"shasum":"9f15a088983e9e649d52e7c0484bc1701a53c7c5","tarball":"https://registry.npmjs.org/expander/-/expander-0.3.2.tgz","integrity":"sha512-62q757003rl0p2ofQQv4tr3rlTGRRBIhjRe9erLD5MaZOxhpgZYaYr/CoZZWpZukkE/axsMaaAIe/7LDqEp4Vg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHul6GJzplmng72/O4pKhSaRVwIHTitAMSqiurixbHtYAiEAjZqn/qNPvXmOMJsOGEE7+m1iIsGiF+EXpL/TjQ1+ppo="}]},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]},"0.3.3":{"name":"expander","description":"Expand template strings in declarative configurations.","version":"0.3.3","homepage":"https://github.com/tkellen/expander","author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"bugs":{"url":"https://github.com/tkellen/expander/issues"},"licenses":[{"type":"MIT","url":"https://github.com/tkellen/expander/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha -R spec test/index.js"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.9.0"},"keywords":["declarative configuration"],"dependencies":{"getobject":"0.1.0","lodash":"~2.2.1"},"_id":"expander@0.3.3","dist":{"shasum":"a2c7b9ce047db2097e2b7cd4315c1e701027fb11","tarball":"https://registry.npmjs.org/expander/-/expander-0.3.3.tgz","integrity":"sha512-H4GSdc+an9X+vCCd+YTwYgzCt4OziBFGKiYJ9EsBX46l4zHwa78jmzDcJhptvS0aSfkqD524q3ba8gcUsBrZbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvEnEgRsh776VWzkBy7qSSyRLqUw6WepCPCD1A9LLEPgIgKZwBDWb4S0mJCCWUIvlUY+bHZmMyweo8Uvx8d3eMGK0="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"tkellen","email":"tyler@sleekcode.net"},"maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}]}},"readme":"# expander [![Build Status](https://secure.travis-ci.org/tkellen/node-expander.png?branch=master)](http://travis-ci.org/tkellen/node-expander)\n\n> Expand template strings in declarative configurations.\n\n## API\n\n### get(data, lookup, imports)\nRetrieve a value from the data object with all template strings resolved.\n\n`data` a configuration object\n`lookup` a dot-notated key\n`options` sent to [_.template](http://lodash.com/docs#template) when resolving values.\n\nExample:\n```js\nvar data = {\n  key: '<%= uppercase(\"foo\") %>'\n};\nexpander.get(data, 'key', {\n  imports: {\n    uppercase: function (str) {\n      return str.toUpperCase();\n    }\n  }\n}); // FOO\n```\n\n### getRaw(data, lookup)\nRetrieve a literal value from the data object.\n\n`data` a configuration object\n`lookup` a dot-notated string representing a key in the configuration\n\n### set(data, lookup, value)\nSet a value in the data object.\n\n`data` a configuration object\n`lookup` a dot-notated string representing a key in the data\n`value` the value to set\n\n### process(data, lookup, options)\nResolve any arbitrary template string.\n\n`data` a configuration object\n`lookup` any string value, typically a template string, e.g. \"<%= key %>\"\n`options` sent to [_.template](http://lodash.com/docs#template) when resolving values.\n\n### interface(data, options)\nBind the above API to a provided data object so you can access it more succinctly.\n\n`data` a configuration object\n`options` sent to [_.template](http://lodash.com/docs#template) automatically when resolving values.\n\n**Note:** When using the interface API, passing options to `get` or `process` will perform a shallow merge over `options` provided when the interface was instantiated.\n\nExample:\n```js\nvar configRaw = {\n  key: 'value',\n  keyRef: '<%= key %>'\n};\nvar config = expander.interface(config);\nconfig('key'); // value\nconfig.get('key'); // value\nconfig('keyRef'); // value\nconfig.get('keyRef'); // value\nconfig('key', 'changed'); // changed\nconfig('key'); // changed\n```\n\n## Examples\n\n```js\nvar expander = require('expander');\n\nvar data = {\n  key: 'value',\n  keyRef: '<%= key %>',\n  recursiveKeyRef: '<%= keyRef %>',\n  arrayRef: ['test', '<%= key %>'],\n  recursiveArrayRef: ['test', '<%= arrayRef %>'],\n  obj: {\n    keyRef: '<%= key %>',\n    recursiveKeyRef: '<%= keyRef %>',\n    arrayRef: ['test', '<%= key %>'],\n    recursiveArrayRef: ['test', '<%= arrayRef %>']\n  },\n  dotRef: '<%= obj.keyRef %>',\n  objRef: '<%= obj %>',\n  interpolated: 'test <%= key %>',\n  interpolatedRecursiveRef: 'test <%= keyRef %>',\n  methodRef: expander.fn(function (config) {\n    // config is the entire config\n    return config.key;\n  }),\n  methodRefContext: expander.fn(function (config) {\n    // this is a reference to expander\n    return this.get(config, 'keyRef');\n  })\n};\n\nexpander.get(data, 'keyRef'); // value\nexpander.get(data, 'recursiveKeyRef'); // value\nexpander.get(data, 'arrayRef'); // ['test', 'value']\nexpander.get(data, 'recursiveArrayRef'); // ['test', ['test', 'value']]\nexpander.get(data, 'obj'); // {\n                           //   keyRef: 'value',\n                           //   recursiveKeyRef: 'value',\n                           //   arrayRef: ['test', 'value'],\n                           //   recursiveArrayRef: ['test', ['test', 'value']]\n                           // }\nexpander.get(data, 'objRef'); // {\n                              //   keyRef: 'value',\n                              //   recursiveKeyRef: 'value',\n                              //   arrayRef: ['test', 'value'],\n                              //   recursiveArrayRef: ['test', ['test', 'value']]\n                              // }\nexpander.get(data, 'interpolated'); // test value\nexpander.get(data, 'interpolatedRecursiveRef'); // test value\nexpander.get(data, 'methodRef'); // value\nexpander.get(data, 'methodRefContext'); // value\n\n// getter setter api\nvar config = expander.interface(data);\nconfig('keyRef'); // value\nconfig('recursiveKeyRef'); // value\nconfig('arrayRef'); // ['test', 'value']\nconfig('recursiveArrayRef'); // ['test', ['test', 'value']]\nconfig('obj'); // {\n               //   keyRef: 'value',\n               //   recursiveKeyRef: 'value',\n               //   arrayRef: ['test', 'value'],\n               //   recursiveArrayRef: ['test', ['test', 'value']]\n               // }\nconfig('objRef'); // {\n                  //   keyRef: 'value',\n                  //   recursiveKeyRef: 'value',\n                  //   arrayRef: ['test', 'value'],\n                  //   recursiveArrayRef: ['test', ['test', 'value']]\n                  // }\nconfig('interpolated'); // test value\nconfig('interpolatedRecursiveRef'); // test value\nconfig('methodRef'); // value\nconfig('methodRefContext'); // value\n```\n\n## Release History\n\n* 2014-02-21 - v0.3.3 - allow overriding default options for _.template in interface api\n* 2014-02-20 - v0.3.2 - allow passing options to _.template\n* 2014-02-11 - v0.3.1 - interface emits events on set\n* 2014-02-10 - v0.3.0 - support a getter/setter api\n* 2013-12-15 - v0.2.2 - support auto expansion of functions\n* 2013-11-21 - v0.2.1 - support ${value} strings\n* 2013-11-08 - v0.2.0 - correctly handle recursively interpolated values\n* 2013-11-05 - v0.1.0 - initial release\n","maintainers":[{"name":"tkellen","email":"tyler@sleekcode.net"}],"time":{"modified":"2022-06-17T22:00:06.745Z","created":"2013-11-06T05:31:04.517Z","0.1.0":"2013-11-06T05:31:06.027Z","0.2.0":"2013-11-08T16:54:05.234Z","0.2.1":"2013-11-21T20:17:03.639Z","0.2.2":"2013-12-15T18:31:33.170Z","0.3.0":"2014-02-10T16:46:26.535Z","0.3.1":"2014-02-11T07:54:55.605Z","0.3.2":"2014-02-20T14:49:55.294Z","0.3.3":"2014-02-21T06:56:43.866Z"},"author":{"name":"Tyler Kellen","url":"http://goingslowly.com/"},"repository":{"type":"git","url":"git://github.com/tkellen/expander.git"},"readmeFilename":"README.md","homepage":"https://github.com/tkellen/expander","keywords":["declarative configuration"],"bugs":{"url":"https://github.com/tkellen/expander/issues"}}