{"_id":"glenlivet","_rev":"29-a81f77b1d404fba04ecf2aded16beed1","name":"glenlivet","description":"Create flexible, reusable processing pipelines powered by plugins.","dist-tags":{"latest":"2.0.3"},"versions":{"0.0.1":{"name":"glenlivet","version":"0.0.1","author":{"name":"Eric Weber","email":"eric@prolificinteractive.com","url":"prolificinteractive.com"},"description":"A hook and plugin system that allows you to create flexible, reusable processing workflows.","keywords":["hooks","plugins","framework"],"repository":{"type":"git","url":"git://github.com/prolificeric/glenlivet"},"main":"./index.js","engines":{"node":"0.10.x"},"dependencies":{"lodash":"~2.4.1"},"devDependencies":{"should":"~2.1.1","mocha":"^1.17.1","blanket":"~1.1.6","coveralls":"^2.8.0","mocha-lcov-reporter":"0.0.1"},"scripts":{"test":"make test"},"bugs":{"url":"https://github.com/prolificeric/glenlivet/issues"},"homepage":"https://github.com/prolificeric/glenlivet","_id":"glenlivet@0.0.1","dist":{"shasum":"97c863c05027f6670893b976e0e72a63071eb32a","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.0.1.tgz","integrity":"sha512-zx2sBVpXZQApcLIrtPNhDXbOnqF8n29JR1pDhwErlwQcfXg9s4kSaON7nwamY/s/SA3YveGNt1oeOrg+jGeowQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPuyNscMFtZHjWgu0QgnRFWkabQZTgizRIzOICOWMm7AIgJynijJF8a9Kel2pbc+NVO+xPc2kaRvZZztivYSHt2WU="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"directories":{}},"0.0.2":{"name":"glenlivet","version":"0.0.2","author":{"name":"Eric Weber","email":"eric@prolificinteractive.com","url":"prolificinteractive.com"},"description":"A hook and plugin system that allows you to create flexible, reusable processing workflows.","keywords":["hooks","plugins","framework"],"repository":{"type":"git","url":"git://github.com/prolificeric/glenlivet"},"main":"./index.js","engines":{"node":"0.10.x"},"dependencies":{"lodash":"~2.4.1"},"devDependencies":{"should":"~2.1.1","mocha":"^1.17.1","blanket":"~1.1.6","coveralls":"^2.8.0","mocha-lcov-reporter":"0.0.1"},"scripts":{"test":"make test"},"bugs":{"url":"https://github.com/prolificeric/glenlivet/issues"},"homepage":"https://github.com/prolificeric/glenlivet","_id":"glenlivet@0.0.2","dist":{"shasum":"b97c0b0a0cfab77b59f44e9fadeb45fb8c1b8249","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.0.2.tgz","integrity":"sha512-E52JSrhKCI9cOvN4hhqx61Ms6r53glOpzue1F/AZWvkj2Ap8vu8mzL65ewgJdjEohv5bIV2v6W2td8o7H/Zq9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwCou9MPbxhNzqmALihE7/Ymku29ejtsGI5fXEtvtwrwIhAOQFVam7JwdZUGyZ89gmgv6eBJZ8FyRKdhybLIJ3a23w"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"directories":{}},"0.0.3":{"name":"glenlivet","version":"0.0.3","author":{"name":"Eric Weber","email":"eric@prolificinteractive.com","url":"prolificinteractive.com"},"description":"A hook and plugin system that allows you to create flexible, reusable processing workflows.","keywords":["hooks","plugins","framework"],"repository":{"type":"git","url":"git://github.com/prolificeric/glenlivet"},"main":"./index.js","engines":{"node":"0.10.x"},"dependencies":{"lodash":"~2.4.1"},"devDependencies":{"should":"~2.1.1","mocha":"^1.17.1","blanket":"~1.1.6","coveralls":"^2.8.0","mocha-lcov-reporter":"0.0.1"},"scripts":{"test":"make test"},"bugs":{"url":"https://github.com/prolificeric/glenlivet/issues"},"homepage":"https://github.com/prolificeric/glenlivet","_id":"glenlivet@0.0.3","dist":{"shasum":"00ce71bb935e54468379e8749c38da1ae72419c1","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.0.3.tgz","integrity":"sha512-Oe9Zo8gg1gg/AJnJMWwaj2jzTelS/H3PI2M7oJ57eSiJyB8krK4SgOCncn/l8/KwhNkn36IRIgbZasW7qMUY6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrpv418YL2gA4m2JaENFUDiJZJBYOblT8KcqMoLgmKpwIhALsmwe+IrBqpMLj1aLM7CL97nINyy6TOodpw0MC+Y+5X"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"directories":{}},"0.0.4":{"name":"glenlivet","version":"0.0.4","author":{"name":"Eric Weber","email":"eric@prolificinteractive.com","url":"prolificinteractive.com"},"description":"A hook and plugin system that allows you to create flexible, reusable processing workflows.","keywords":["hooks","plugins","framework"],"repository":{"type":"git","url":"git://github.com/prolificeric/glenlivet"},"main":"./index.js","engines":{"node":"0.10.x"},"dependencies":{"lodash":"~2.4.1"},"devDependencies":{"should":"~2.1.1","mocha":"^1.17.1","blanket":"~1.1.6","coveralls":"^2.8.0","mocha-lcov-reporter":"0.0.1"},"scripts":{"test":"make test"},"bugs":{"url":"https://github.com/prolificeric/glenlivet/issues"},"homepage":"https://github.com/prolificeric/glenlivet","_id":"glenlivet@0.0.4","dist":{"shasum":"d351732db61ee72045dc64ac707dbc8e946bc66b","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.0.4.tgz","integrity":"sha512-2ND/6bpVcLdPapTkB05qf+vdSOmeNh+y3HpmQV59LZJbXfh4f09clpKtkvnWPoU/fckaKJ9Z9cNP5Ad6FNGi2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEu8up97AkIqvbPvb+wH3axBWjHm7bY9oYSN947c8oTVAiEAt708A3xCm24ItU7ejgQvzp/kGwI815E/P7k2Fyhd7nA="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"directories":{}},"0.1.1":{"name":"glenlivet","version":"0.1.1","description":"Build extensible processing pipelines.","main":"index.js","scripts":{"test":"make test"},"author":"","license":"ISC","dependencies":{"cheerio":"^0.17.0","express":"^4.9.8","lodash":"^2.4.1","request":"^2.45.0"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^1.21.4","should":"^4.0.4"},"gitHead":"4596a4c79ff24febf8a4c2d9b654e9bd8ad11cf6","_id":"glenlivet@0.1.1","_shasum":"9ee2efd55db157f2dac052911f9db773b79a3cc8","_from":".","_npmVersion":"2.0.0-beta.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"9ee2efd55db157f2dac052911f9db773b79a3cc8","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.1.1.tgz","integrity":"sha512-//L5AVfnAa0qd9mHGnY3EJGqJZ31ES30dm3nOs3dvMN3BdB3TXZpOHQTHYIpa4TxFGqJaKjc1/CsrN7ch/cZMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZBDrYplnNjoMHgxNhGe0drMMiTd/QGfNy6sHiMOPX4AiA9XQEWJeZR6FOGfqdy0Ne8UgvxnDgUqyaBByO9o0wnuw=="}]},"directories":{}},"0.1.2":{"name":"glenlivet","version":"0.1.2","description":"Build extensible processing pipelines.","main":"index.js","scripts":{"test":"make test"},"author":"","license":"ISC","dependencies":{"body-parser":"^1.9.1","cheerio":"^0.17.0","cookie-parser":"^1.3.3","express":"^4.9.8","lodash":"^2.4.1","request":"^2.45.0"},"devDependencies":{"coffee-script":"^1.8.0","mocha":"^1.21.4","should":"^4.0.4"},"gitHead":"2c5f3e8f4e723451676f351bf4f304191c3a061c","_id":"glenlivet@0.1.2","_shasum":"438af4e063bde163ebdf925e57a7e9d69cef3ccd","_from":".","_npmVersion":"2.0.0-beta.3","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"438af4e063bde163ebdf925e57a7e9d69cef3ccd","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-0.1.2.tgz","integrity":"sha512-4OrulwS50BjhEqSkCPVPFufkprS2Vpx5truZ6YE11TzXLdf9N7nzNLinWNE4yNL1aMAep1+ZAALffNalw52qsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5MJoGonTQcKk0y8aaKk49x7aqQEr4Uv+1I4yUnSYveAiB/VX9qxoSneHvZchJN2CGd7s+EK1GrM0OyKT6tZ0wfzw=="}]},"directories":{}},"2.0.0":{"name":"glenlivet","version":"2.0.0","description":"Create flexible, reusable processing pipelines powered by plugins.","main":"index.js","scripts":{"test":"grunt test"},"author":{"name":"Eric Weber","email":"eric@prolificinteractive.com"},"license":"MIT","dependencies":{"cheerio":"^0.18.0","lodash":"^2.4.1","q":"^1.1.1"},"devDependencies":{"grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-jsbeautifier":"^0.2.7","grunt-mocha-test":"^0.12.4","jshint":"^2.5.10","mocha":"^2.0.1","should":"^4.3.0"},"gitHead":"aa711e0a5b151f769d32fb9619da319971838b30","_id":"glenlivet@2.0.0","_shasum":"319a81af059ae6cc45ad2fabd7e26195aee6c1b2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"319a81af059ae6cc45ad2fabd7e26195aee6c1b2","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-2.0.0.tgz","integrity":"sha512-OxWbehMKekH2Iy0xDXHsK1EQqDweRwhDbUjTafd6Y1ENqAjLBM+yCx8NQmrgOqCdvvsURf0juCt7tmzf+uVsMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5Oc+U91KgXvtAwxzeUBhjaThHfHWc4ivrYzy6DnkFnAiAycktpBk3CLOx9CbcUXoR3Z7mQYzXrtn0lPMvnXn4akg=="}]},"directories":{}},"2.0.1":{"name":"glenlivet","version":"2.0.1","description":"Create flexible, reusable processing pipelines powered by plugins.","main":"index.js","scripts":{"test":"grunt test"},"author":{"name":"Eric Weber","email":"eric@prolificinteractive.com"},"license":"MIT","dependencies":{"cheerio":"^0.18.0","lodash":"^2.4.1","q":"^1.1.1"},"devDependencies":{"express":"^4.10.6","grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-jsbeautifier":"^0.2.7","grunt-mocha-test":"^0.12.4","jshint":"^2.5.10","mocha":"^2.0.1","should":"^4.3.0"},"gitHead":"e2f7ba737625d3f4e6b56adbd323d4e5ef3e634a","_id":"glenlivet@2.0.1","_shasum":"d2f789c49257ffe53b9f923374e7a4987d648f27","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"d2f789c49257ffe53b9f923374e7a4987d648f27","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-2.0.1.tgz","integrity":"sha512-1m5m2JRDggNDLBXHH7wHN5ny/MryIGoXfQ/lrsAwXdvnbT58q1mb7IGD7C2t+GFyMNu0c/Ciop4FUawnXOGIQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBu2xbVYKKICl4tkoe+LNXpzrdI4lbK9tkhrxB+ImLMAiAP2ttMt/peDXYKVB0+gmOC9LOpIDRAaDNAvtVLxcTKGA=="}]},"directories":{}},"2.0.2":{"name":"glenlivet","version":"2.0.2","description":"Create flexible, reusable processing pipelines powered by plugins.","main":"index.js","scripts":{"test":"grunt test"},"author":{"name":"Eric Weber","email":"eric@prolificinteractive.com"},"license":"MIT","dependencies":{"cheerio":"^0.18.0","lodash":"^2.4.1","q":"^1.1.1"},"repository":{"type":"git","url":"https://github.com/prolificinteractive/node-html-to-json"},"devDependencies":{"express":"^4.10.6","grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-jsbeautifier":"^0.2.7","grunt-mocha-test":"^0.12.4","jshint":"^2.5.10","mocha":"^2.0.1","should":"^4.3.0"},"gitHead":"7d5eecf7f3a84c8f7a1a28cb9d12555595c4df7c","bugs":{"url":"https://github.com/prolificinteractive/node-html-to-json/issues"},"homepage":"https://github.com/prolificinteractive/node-html-to-json","_id":"glenlivet@2.0.2","_shasum":"890418a9122389f9f896c3d1d80f1710a0587333","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"890418a9122389f9f896c3d1d80f1710a0587333","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-2.0.2.tgz","integrity":"sha512-PEhcgEFF9MG7AW9+MOgZs1b5sLoE8gtWuFMicP1Wlc9AlusaKZKi+/nE/nI/A9RATZ2yXyXfIhqLLG9Ierf9Mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPGtWC6wlF6MpiTbDxC/TxrAEyjHX0wlzBcnkoSNRWLgIhAOiBPfkSrB60addd13gjvKlViGFhKiZjLUhGMEIRZPWq"}]},"directories":{}},"2.0.3":{"name":"glenlivet","version":"2.0.3","description":"Create flexible, reusable processing pipelines powered by plugins.","main":"index.js","scripts":{"test":"grunt test"},"author":{"name":"Eric Weber","email":"eric@prolificinteractive.com"},"license":"MIT","dependencies":{"cheerio":"^0.18.0","lodash":"^2.4.1","q":"^1.1.1"},"repository":{"type":"git","url":"https://github.com/prolificinteractive/node-html-to-json"},"devDependencies":{"express":"^4.10.6","grunt":"^0.4.5","grunt-contrib-jshint":"^0.10.0","grunt-jsbeautifier":"^0.2.7","grunt-mocha-test":"^0.12.4","jshint":"^2.5.10","mocha":"^2.0.1","should":"^4.3.0"},"gitHead":"1af4bc2ed9a021f6fd73574e70d7490b87726654","bugs":{"url":"https://github.com/prolificinteractive/node-html-to-json/issues"},"homepage":"https://github.com/prolificinteractive/node-html-to-json","_id":"glenlivet@2.0.3","_shasum":"b72a77e6ae847d3f895176cb016bbbd8dd65def6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"prolificeric","email":"eric@prolificinteractive.com"},"maintainers":[{"name":"prolificeric","email":"eric@prolificinteractive.com"}],"dist":{"shasum":"b72a77e6ae847d3f895176cb016bbbd8dd65def6","tarball":"https://registry.npmjs.org/glenlivet/-/glenlivet-2.0.3.tgz","integrity":"sha512-jAmvOPVJfle+ZGTuAnGk4G4Mad5EaeMa6hZV21oJouaAbfaM9FRlOqz05TlaEMo9GcDxL3EcbJu/qQ4HznKMAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlKPYXAVQGsUPJAVkqwtPItittHw+Y7N14R9gIg/FygAiEA/gUZB1ooZeO1AnG+iAcUL662iLLJuq+16X5xuqu8RtA="}]},"directories":{}}},"readme":"# Glenlivet\n\nCreate flexible, reusable processing pipelines powered by plugins.\n\n## Installation\n\n`npm install glenlivet`\n\n## Usage\n\n### Bottles\n\nBottles encapsulate a hierarchical system of named hooks. When a bottle is \"served\", it traverses the hooks and runs any middleware attached to each.\n\n#### Plugins\n\nPlugins modify bottles by extending the hook hierarchy, attaching middleware, or adding methods. You add them to bottles with the .plugins() method:\n\n```javascript\nvar htmlToJsonPlugin = require('glenlivet-htmltojson');\nvar requestPlugin = require('glenlivet-request');\n\nvar getStructure = glenlivet.createBottle({\n  request: {\n    uri: function (data) {\n      return data.uri;\n    }\n  },\n  htmlToJson: ['> *', {\n    'id': function ($el) {\n      return $el.attr('id') || null;\n    },\n    'tagName': function ($el) {\n      return $el[0].tagName;\n    },\n    'className': function ($el) {\n      return $el.attr('class') || null;\n    },\n    'children': function () {\n      return this.recurse();\n    }\n  }]\n}).plugins([\n  htmlToJsonPlugin,\n  requestPlugin\n]);\n```\n\nPlugins are loaded if their namespace exists as a key within the bottle configuration.\n\n### Barrels\n\nBarrels group together bottles, and provide functionality like configuration defaults, plugin autoloading, and global middleware for member bottles.\n\n```javascript\nvar glenlivet = require('glenlivet');\n\nvar prolific = glenlivet.createBarrel({\n  plugins: [\n    require('glenlivet-request'),\n    require('glenlivet-htmltojson')\n  ],\n  pluginDefaults: {\n    request: {\n      host: 'www.prolificinteractive.com'\n    }\n  }\n});\n\nvar getLinks = prolific.bottle('getLinks', {\n  request: {\n    pathname: function (data) {\n      return data.page || '/';\n    }\n  },\n  htmlToJson: ['a[href]', {\n    'href': function ($a) {\n      return $a.attr('href');\n    },\n    'text': function ($a) {\n      return $a.text();\n    }\n  }]\n}).method('json');\n```\n\nAny `plugins` will be loaded with each bottle, as long as they have the config key corresponding to the plugin's namespace. Any `pluginDefaults` will be mixed into the bottle configuration for the corresponding plugins.\n\n### Writing Plugins\n\n#### Middleware\n\nBottles come with a set of default middleware hooks:\n- `preempt`: Things that might make the rest of the middleware unnecessary, for example caching.\n- `setup`: Getting options prepared for `process` middleware. The main purpose is to allow other plugins to modify those options.\n- `process`: For data-generating procedures, for example making an HTTP request.\n- `filter`: Transforms data created by `process` middleware.\n- `persist`: Meant for things like caching to save the results at the end of the pipeline.\n\n#### glenlivet.createPlugin()\n\nPlugins are created using the glenlivet.createPlugin() method. This method takes two arguments, the first being the configuration namespace it will use, and a callback that is called every time the plugin is used by a bottle. The first argument of that function is the configuration for that plugin, while `this` corresponds to the bottle.\n\nYou'll mostly be using the bottle's middleware() method to read and write new values on the data object, like so:\n\n```javascript\nvar htmlToJson = require('htmlToJson');\nvar glenlivet = reuqire('glenlivet');\n\nmodule.exports = glenlivet.createPlugin('htmlToJson', function (filter) {\n  this.middleware('filter:htmlToJson', function (data, next, done) {\n    htmlToJson\n      .parse(data.html, filter)\n      .done(function (json) {\n        data.json = json;\n        next();\n      }, done);\n  });\n});\n```\n\nNotice the name of the middleware `filter:htmlToJson`. It will automatically create that hook within the existing `filter`. However, the hook will not be added if the immediate parent does not exist. For example, `filter:a:b:c` will not work until all ancestors are added to the hook hierarchy. This way we can create sub-plugins that depend on the existence of another plugin to work.\n\n## Examples\n\n[A scraped API with htmlToJson, request, and Express](examples/prolific.js)\n","maintainers":[{"email":"eric@prolificinteractive.com","name":"ericweber"}],"time":{"modified":"2022-06-18T12:50:45.907Z","created":"2014-03-11T19:53:34.433Z","0.0.1":"2014-03-11T19:53:34.433Z","0.0.2":"2014-03-12T16:29:28.760Z","0.0.3":"2014-03-13T01:31:26.161Z","0.0.4":"2014-03-13T17:12:43.804Z","0.1.1":"2014-10-22T17:39:14.735Z","0.1.2":"2014-10-30T18:29:38.761Z","2.0.0":"2014-12-15T02:02:39.596Z","2.0.1":"2014-12-15T03:13:18.296Z","2.0.2":"2014-12-15T21:55:26.186Z","2.0.3":"2015-01-10T22:47:46.035Z"},"readmeFilename":"README.md","users":{"fgribreau":true},"license":"MIT","author":{"name":"Eric Weber","email":"eric@prolificinteractive.com"},"homepage":"https://github.com/prolificinteractive/node-html-to-json","repository":{"type":"git","url":"https://github.com/prolificinteractive/node-html-to-json"},"bugs":{"url":"https://github.com/prolificinteractive/node-html-to-json/issues"}}