{"_id":"hapi-bookshelf-total-count","_rev":"160-b1c745c5742b079ebf61d5a9234105a6","name":"hapi-bookshelf-total-count","dist-tags":{"latest":"5.1.1"},"versions":{"1.0.0":{"name":"hapi-bookshelf-total-count","version":"1.0.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@1.0.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"dist":{"shasum":"173d0b6b23b2879f0f1d6f85da6929d6a586a6e2","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-1.0.0.tgz","integrity":"sha512-hBzJnn6DByUiOJIoz5fEczPfLIyMNySoR+RvyRtHITdo6TDUcTlSJ4pt4s11v8OHs9wIrl4rsqS9eUDePT+KDw==","signatures":[{"sig":"MEUCIGa/Pq/uKR8ixKKTDfj/8zcN8jtjkKN8+Jt15FAoTDxPAiEAkKSW7KnmtElT7aEgWQH4sFH5qf1Qx5HMvUarm2OgZ2Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"173d0b6b23b2879f0f1d6f85da6929d6a586a6e2","gitHead":"a8cdb6a286b0f94fd8687b4d8e4ea98956c2c6cc","scripts":{"lint":"eslint .","test":"istanbul cover _mocha -- test --require test/setup.js --recursive --timeout 30000","enforce":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"3.3.12","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"5.2.0","dependencies":{"joi":"^8.0.5","bluebird":"^3.3.4"},"devDependencies":{"chai":"^3.0.0","hapi":"^11.1.2","knex":"^0.10.0","mocha":"^2.2.5","eslint":"^1.9.0","sqlite3":"^3.1.2","istanbul":"^0.4.2","bookshelf":"^0.9.4","inject-then":"^2.0.5","eslint-config-lob":"^2.0.0","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"hapi":"11.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count-1.0.0.tgz_1460069000678_0.43312130216509104","host":"packages-12-west.internal.npmjs.com"}},"2.0.0":{"name":"hapi-bookshelf-total-count","version":"2.0.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@2.0.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"dist":{"shasum":"d2e2efefd9d924c6b4cec8993343b56eed717703","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-2.0.0.tgz","integrity":"sha512-RcHmO/pC/i/ovAAxeiMC5PEfDPuKhyYMP56NoakcDi8A/HOXyp1KUcM+DBOk4JTZsDkadCfKfly5kyS9H/SH9A==","signatures":[{"sig":"MEUCIEujMZJNgqRoyB7x+muNMVJbzc5JuP362wZg8fmRCvLuAiEAojDTqWTRFX6VVfNjNAG5v9hk9Rxj64NNm3029vq6JmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"d2e2efefd9d924c6b4cec8993343b56eed717703","gitHead":"fd495e312eada11ded54971916cea77dce1c15f5","scripts":{"lint":"eslint .","test":"istanbul cover _mocha -- test --require test/setup.js --recursive --timeout 30000","enforce":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"3.3.12","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"5.2.0","dependencies":{"joi":"^8.0.5","bluebird":"^3.3.4"},"devDependencies":{"chai":"^3.0.0","hapi":">=12.x","knex":"^0.10.0","mocha":"^2.2.5","eslint":"^1.9.0","hapi-qs":"1.x","sqlite3":"^3.1.2","istanbul":"^0.4.2","bookshelf":"^0.9.4","inject-then":"^2.0.5","eslint-config-lob":"^2.0.1","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"hapi":">=12.x","hapi-qs":"1.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count-2.0.0.tgz_1466464875647_0.9630351329687983","host":"packages-16-east.internal.npmjs.com"}},"3.0.0":{"name":"hapi-bookshelf-total-count","version":"3.0.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@3.0.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"dist":{"shasum":"2c18ed60db2a8fe086f9136b6e1ca44fbe8addfe","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-3.0.0.tgz","integrity":"sha512-g+I4NMbx3kXJaNz8Uz8QXbALVbvDzmXyrFX/yAHFSVcr42zvRPxov/3HiHtPUfK/vKgCAixen0ubSKEfJOEtdg==","signatures":[{"sig":"MEQCIFyeMxM95JTm1A8EBI+H/uG+e7ZrHXdEA/0ZDjGk6tzeAiAwwj03U7MneMhwn+u7icrI8+sbA1LtYXM+6so0ygLk7g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"2c18ed60db2a8fe086f9136b6e1ca44fbe8addfe","gitHead":"8d9d058bb57215aaf2422bd77d61dc2020056159","scripts":{"lint":"eslint .","test":"istanbul cover _mocha -- test --require test/setup.js --recursive --timeout 30000","enforce":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"3.3.12","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"5.2.0","dependencies":{"joi":"^8.0.5","bluebird":"^3.3.4","object-hash":"^1.1.4"},"devDependencies":{"chai":"^3.0.0","hapi":">=12.x","knex":"^0.10.0","mocha":"^2.2.5","redis":"^2.6.2","eslint":"^1.9.0","hapi-qs":"1.x","sqlite3":"^3.1.2","istanbul":"^0.4.2","bookshelf":"^0.9.4","then-redis":"^2.0.1","inject-then":"^2.0.5","eslint-config-lob":"^2.0.1","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"hapi":">=12.x","hapi-qs":"1.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count-3.0.0.tgz_1474555829798_0.5460705317091197","host":"packages-16-east.internal.npmjs.com"}},"4.0.0":{"name":"hapi-bookshelf-total-count","version":"4.0.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@4.0.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"dist":{"shasum":"69d545e63b4edb6f532b2a1f64980729ba777b22","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-4.0.0.tgz","integrity":"sha512-k/mN80UjMOP4lT21OE+wJ4wUAn4Z5EHdqzDO6b9NgRA/uZ5cmfuv/88TY3N38Hkqm/pkg8JpE2XEEEnj1NyOlQ==","signatures":[{"sig":"MEUCICAeGs1GzIc0+h9OUe+Pun8UHZOSZkHMtG3U62IY2GaUAiEA/4kuVf2pVgmNwY+NCWiwC13Wqj94pIQkKEzXsZeWCCU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"69d545e63b4edb6f532b2a1f64980729ba777b22","gitHead":"db0f3830faccd87ca64bebb505e946857add2f2d","scripts":{"lint":"eslint .","test":"istanbul cover _mocha -- test --require test/setup.js --recursive --timeout 30000","enforce":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"3.3.12","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"5.2.0","dependencies":{"joi":"^8.0.5","bluebird":"^3.3.4","object-hash":"^1.1.4"},"devDependencies":{"chai":"^3.0.0","hapi":">=12.x","knex":"^0.10.0","mocha":"^2.2.5","redis":"^2.6.2","eslint":"^1.9.0","hapi-qs":"1.x","sqlite3":"^3.1.2","istanbul":"^0.4.2","bookshelf":"^0.9.4","inject-then":"^2.0.5","eslint-config-lob":"^2.0.1","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"hapi":">=12.x","hapi-qs":"1.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count-4.0.0.tgz_1477939571857_0.49548984272405505","host":"packages-12-west.internal.npmjs.com"}},"4.1.0":{"name":"hapi-bookshelf-total-count","version":"4.1.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@4.1.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"dist":{"shasum":"a5d7b210ce1c7c653320f93ee46acf0afa51794c","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-4.1.0.tgz","fileCount":25,"integrity":"sha512-5l7F/90H9NXErYhDx3WcGBie11ULQZcjL4vaFDKD+QT1+fnoCUkVSW5WCMI/fvoUN0dYQNNNZeJF4G45NOWT1g==","signatures":[{"sig":"MEUCIQDy3zS7VtVLxWl1yiIk0CDpNHGMu6+8XaliLO6ArAsOcQIgYc4fM7QhB/faTJecHPkU9nDc9J1tn0RPw7LCigM5/E4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboH3yCRA9TVsSAnZWagAA2JgP/ApzUsBdD/g7n+7CS6m0\nLVgyY4pxr8He/jCIX4kkza+g4bAVrwpvr/nkiXD3HCuOX4kqeimWXrcKizPs\nWWaY/aghyYmEdzfMMseUsP9eC7tJvf7wLuge0Zma5AolOGCb1n1FPq8JOiFZ\nrlmtXhkfIwAQ8Luftlh14iy6J+RY8MxueXADZn55zCoCzwDqsd3XjQVQNhj9\nbgo2fIX1OrYNrKJysS5HtLiwYSHXEJC9bH3YjkAQuAW7LcFW4i1Xu7y1Hmsx\nMDDLniuEBjKW/Kkp4n173AOWT/pFnjTGdtzddjHekdjdLgdyrLn413AZjdow\nEh+nhTAYw0rvD6o5aVA+krxLnOokuA+OTRe8r4ijBIopHnn6SdAzbYAsnnON\nzcoX+ATesrHJs6+PqugbM/Cf43BmjO/jLMsjQyY709uPJChcVZoxj1Ks1Isu\niw28A5RsbLY4xy0OxzQqBWdwuM4bGqcR/i9Vh8XarOo3WspmHTJ4uqW3RlGs\n/L9sjuyKXUJ9EIMrHi/97M8k3Ij6hdeNe13doGk1aNp9k6QxbhJuCDbvt/0G\nWORsQRm2BFZus3YxA+e46utYft+iQwlUOIYmQdG/zOInBrh0ePN0vhpk+7Mi\nwoBtM1gkmz+VU3wttaXZRF+AwNBX3sLN/XrER/Z0Pvy6f5sEIRGNGRu5wSD+\njDtf\r\n=C9Nu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"028b37cd412f0e52b40c26c6b1f1f36d41880346","scripts":{"lint":"eslint .","test":"istanbul cover _mocha -- test --require test/setup.js --recursive --timeout 30000","enforce":"istanbul check-coverage --statement 100 --branch 100 --function 100 --lines 100","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"5.6.0","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"8.11.3","dependencies":{"joi":"^8.0.5","bluebird":"^3.3.4","object-hash":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^3.0.0","hapi":"^16.0.0","knex":"^0.10.0","mocha":"^2.2.5","redis":"^2.6.2","eslint":"^1.9.0","hapi-qs":"1.x","sqlite3":"^3.1.2","istanbul":"^0.4.2","bookshelf":"^0.9.4","inject-then":"^2.0.5","eslint-config-lob":"^2.0.1","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"hapi":"^16.0.0","hapi-qs":"1.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count_4.1.0_1537244657765_0.6252733165835105","host":"s3://npm-registry-packages"}},"4.3.0":{"name":"hapi-bookshelf-total-count","version":"4.3.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@4.3.0","maintainers":[{"name":"lob","email":"engineering@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"nyc":{"lines":100,"branches":100,"reporter":["lcov","text-summary"],"functions":100,"statements":100},"dist":{"shasum":"913200b6680d4e64920e7f16b22a80e9ae886283","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-4.3.0.tgz","fileCount":29,"integrity":"sha512-YyAJVd/JxNazz7sAn3iBvsBmT5vQf5DVsQnOzavfum2aNvE6jzVZeYFhg4PyV3o3TbHZ9DyVCSBRS6NjiAOfNQ==","signatures":[{"sig":"MEUCIQCWg4RoWLRiQD9LK7EG4+PAzmSHqQkOFzZC3sQAfF01DQIgZrV1OTWFLrKVlGaFs6FR5o3/eqQealz5YyU/mRDi5Do=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":183175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOJdiCRA9TVsSAnZWagAA7mIP/RZhGt8adRIEF7lsxQDg\nJ96ggPAi4Oxqa/54Yw//gjxZIXTAzeB9yiWrs7xsmhfSPgwfos8YCBgxwxRn\n2psGilj4Xz3XIs75WzfoCcIJZTlW15D5kxxv975gbOxLwkRC1FOyO5+Ad31S\nM2kuC49WSPJic1emQhAlk2tE56TYRhJOp5jahRqSF80q8eleCkT9QTNXUcSu\nttIeeL3NOqRlopKiPpu7By1nKg6MKV74t+ACIKustAUzoq+RYinI4KS7knWn\n6/jIuq5fqJA5jLpSkuADKGsaXe3oQAHR95j0nrIony7jQX53gGV5jlXDJ62W\nW0TluM7fQl6O/gOKPShXPiYStlfTgkNQ8OFfpszFvKWWdD4RepfLdFnBZiJ0\nzLb2wzl5tj7uJwtKdEqJG5uEuIn0a/HHMa7YUz8kO4zGu3+YpT8ebJGWlJuo\nrNgQFoEIrjVy5Fs5uQd59PsjWnavygDorRJ+5X3hnDUlonilfzfKLwgvRDTy\n8gJ+99k9JgRqzrAscYWTbm/hbJFbv858SpIg5gKkcbN710qjC6sBBqcVslXg\nl8Zmh3jgHeggbwkaShOm+Q06CW0iEBNFElDEwySeW1qyyLv2Hh8zo243taTU\nG4zSfCRBN6tNReHUWWg3TQQwl6PJDh5MdsqMr+AgE/JgyMrehdbIQdQBks8k\nUa4o\r\n=ju4J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"7431115e3171ff81337ed1b3ad114b2a467b40f4","scripts":{"lint":"eslint .","test":"nyc _mocha test --exit --require test/setup.js --recursive --timeout 30000","enforce":"nyc check-coverage","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"lob","email":"engineering@lob.com"},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"6.4.1","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"8.15.1","dependencies":{"bluebird":"^3.3.4","object-hash":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"joi":"^11.4.0","nyc":"^14.1.1","chai":"^4.1.2","hapi":"^16.0.0","knex":"^0.14.5","mocha":"^5.2.0","redis":"^2.6.2","eslint":"^4.19.1","hapi-qs":"1.x","sqlite3":"^3.1.2","bookshelf":"^0.12.0","inject-then":"^2.0.5","eslint-config-lob":"^3.0.0","hapi-query-filter":"^1.0.1","generate-changelog":"^1.0.0"},"peerDependencies":{"joi":"^11.4.0","hapi":"^16.0.0","hapi-qs":"1.x","bookshelf":">=0.8.2"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count_4.3.0_1563989857971_0.7295558561783384","host":"s3://npm-registry-packages"}},"5.0.0":{"name":"hapi-bookshelf-total-count","version":"5.0.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@5.0.0","maintainers":[{"name":"joemeers82","email":"joemeers82@gmail.com"},{"name":"vikita.bhandari","email":"vikita.bhandari@lob.com"},{"name":"matthew.burke","email":"matthew.burke@lob.com"},{"name":"jarrod-lob","email":"jarrod.petrovics@lob.com"},{"name":"klaus.opreschko.lob","email":"klaus.opreschko@lob.com"},{"name":"pkamatlob","email":"prasad.kamat@lob.com"},{"name":"philthelobster","email":"phil.switzer@lob.com"},{"name":"ngnasr1123_lob","email":"nader.nasr@lob.com"},{"name":"jayteelob","email":"jaytee.sanchez@lob.com"},{"name":"erik.forsman-lob","email":"erik.forsman@lob.com"},{"name":"jkleung11","email":"jon.leung@lob.com"},{"name":"tanya.sah","email":"tanya.sah@lob.com"},{"name":"hunteryoakum","email":"hunter.yoakum@lob.com"},{"name":"rdimouro7373","email":"rachel.decker@lob.com"},{"name":"lobstertroy","email":"troy.armstrong@lob.com"},{"name":"joshnkoy","email":"josh.nkoy@lob.com"},{"name":"michel_lob","email":"michel.perez@lob.com"},{"name":"haroutrs","email":"harout.stepanyan@lob.com"},{"name":"kjones_lob","email":"kevin.jones@lob.com"},{"name":"eamon-barisone","email":"eamon.barisone@lob.com"},{"name":"nathanielwaldschmidtlob","email":"nathaniel.waldschmidt@lob.com"},{"name":"zach.reed","email":"zach.reed@lob.com"},{"name":"kencrim","email":"ken.crimmins@lob.com"},{"name":"jorgelob","email":"jorge.vivas@lob.com"},{"name":"nick-place-lob","email":"nick.place@lob.com"},{"name":"andrew.guterres","email":"andrew.guterres@lob.com"},{"name":"hanqingchen-lob","email":"hanqing@lob.com"},{"name":"juan.frissdekereki","email":"juan.frissdekereki@lob.com"},{"name":"mmorgan-lob","email":"michael.morgan@lob.com"},{"name":"vmangwani","email":"vmangwani@lob.com"},{"name":"sachinlob","email":"sachin@lob.com"},{"name":"nick.perri","email":"nick.perri@lob.com"},{"name":"siddharthpant92","email":"siddharth.pant@lob.com"},{"name":"bethqiang","email":"beth.qiang@lob.com"},{"name":"kplob","email":"ken.pflum@lob.com"},{"name":"samkitsheth95","email":"samkit.sheth@lob.com"},{"name":"erin-doyle","email":"erin.doyle@lob.com"},{"name":"jfdavidson","email":"james.davidson@lob.com"},{"name":"meussdorffer","email":"jack.meussdorffer@lob.com"},{"name":"shannamurry","email":"shanna.murry@lob.com"},{"name":"amaan_lob","email":"amaan@lob.com"},{"name":"team.platform.lob.com","email":"team.platform@lob.com"},{"name":"elijah-lob","email":"elijah@lob.com"},{"name":"barnabygo","email":"barnaby.go@lob.com"},{"name":"james.cho","email":"james.cho@lob.com"},{"name":"douglaje","email":"james.douglas@lob.com"},{"name":"lob-owner","email":"lob.npm.owner@lob.com"},{"name":"graeme.lowe.lob","email":"graeme.lowe@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"nyc":{"lines":100,"branches":100,"reporter":["lcov","text-summary"],"functions":100,"statements":100},"dist":{"shasum":"ba564aec955c31256169409e6278a7d634c9c7ae","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-5.0.0.tgz","fileCount":26,"integrity":"sha512-HSq4usotoLix+mO3AZd/QRFz6JoJqan6yjcdQWbOqE6okXyvjdOAcx0LxNbsG7riG8ZZHJXStNj0gJjx5j7eeg==","signatures":[{"sig":"MEYCIQCGVDchKNh0BZCi6Rzp2JT4qEZtby85Xh489W2xpMI3ygIhALyb1fTkBy7kIpYENj88yse7SOmK47aCJRmju1SlvBaP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31786},"main":"lib/index.js","gitHead":"bb5954dff5b1fa65f57c6cadc10dc7e2a85d33b4","scripts":{"lint":"eslint .","test":"nyc _mocha test --exit --require test/setup.js --recursive --timeout 30000","enforce":"nyc check-coverage","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","release:major":"changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags","release:minor":"changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags","release:patch":"changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags"},"_npmUser":{"name":"team.platform.lob.com","email":"team.platform@lob.com"},"overrides":{"bookshelf":{"knex":"^3.1.0"}},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"10.7.0","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"20.15.0","dependencies":{"rimraf":"^6.0.1","object-hash":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"qs":"^6.13.0","joi":"^17.13.3","nyc":"^14.1.1","chai":"4.5.0","knex":"^3.1.0","mocha":"^10.7.3","redis":"^4.7.0","eslint":"8.57.0","sqlite3":"^5.1.7","bookshelf":"^1.2.0","@hapi/hapi":"^21.3.10","eslint-config-lob":"^6.0.0","hapi-query-filter":"^5.0.0","generate-changelog":"^1.8.0"},"peerDependencies":{"joi":"^17.13.3","bookshelf":">=1.2.0","@hapi/hapi":"^21.3.10"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count_5.0.0_1726593980097_0.5132882581720264","host":"s3://npm-registry-packages"}},"5.1.0":{"name":"hapi-bookshelf-total-count","version":"5.1.0","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@5.1.0","maintainers":[{"name":"shannamurry","email":"shanna.murry@lob.com"},{"name":"siddharthpant92","email":"siddharth.pant@lob.com"},{"name":"lob-owner","email":"lob.npm.owner@lob.com"},{"name":"barnabygo","email":"barnaby.go@lob.com"},{"name":"team.platform.lob.com","email":"team.platform@lob.com"},{"name":"samkitsheth95","email":"samkit.sheth@lob.com"},{"name":"kplob","email":"ken.pflum@lob.com"},{"name":"vmangwani","email":"vmangwani@lob.com"},{"name":"nathanielwaldschmidtlob","email":"nathaniel.waldschmidt@lob.com"},{"name":"eamon-barisone","email":"eamon.barisone@lob.com"},{"name":"andrew.guterres","email":"andrew.guterres@lob.com"},{"name":"mmorgan-lob","email":"michael.morgan@lob.com"},{"name":"vikita.bhandari","email":"vikita.bhandari@lob.com"},{"name":"lobstertroy","email":"troy.armstrong@lob.com"},{"name":"hunteryoakum","email":"hunter.yoakum@lob.com"},{"name":"erik.forsman-lob","email":"erik.forsman@lob.com"},{"name":"joemeers82","email":"joemeers82@gmail.com"},{"name":"matthew.burke","email":"matthew.burke@lob.com"},{"name":"kjones_lob","email":"kevin.jones@lob.com"},{"name":"rromit.lob","email":"rishabh.romit@lob.com"},{"name":"tanya.sah","email":"tanya.sah@lob.com"},{"name":"jayteelob","email":"jaytee.sanchez@lob.com"},{"name":"hpelletier","email":"haley.pelletier@lob.com"},{"name":"philthelobster","email":"phil.switzer@lob.com"},{"name":"benjaminkitt","email":"benjamin@benjaminkitt.com"},{"name":"olaotangeorge","email":"olaotan.george@lob.com"},{"name":"mathiaswolf","email":"mathias.g.wolf@gmail.com"},{"name":"sammelero","email":"sam.melero@lob.com"},{"name":"senftleber-lob","email":"michael.senftleber@lob.com"},{"name":"ryanlob","email":"ryan.williams@lob.com"},{"name":"graeme.lowe.lob","email":"graeme.lowe@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"nyc":{"lines":100,"branches":100,"reporter":["lcov","text-summary"],"functions":100,"statements":100},"dist":{"shasum":"129bb0a545db7d47ac9b933407a823d8ed1a2c2e","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-5.1.0.tgz","fileCount":26,"integrity":"sha512-kK0G+3Gvm3KQ83TxKW2K3dc53z00EG02mi0H/m+2b0dAcaVdQYDL8Zx/9UBjJlbAA3w1Up6ZSiZKgAY8od8cKw==","signatures":[{"sig":"MEYCIQCHWQf6/tH/pDBqrqxkFFgzI0chUln0eSseAx3M4KiJSQIhAJ6Ka8SQeDxG12v8IilVUJh2TnwlzGDoqQrIZHVG5aj0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/hapi-bookshelf-total-count@5.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":32948},"main":"lib/index.js","engines":{"npm":">=11.5.1","node":">=20.17.0"},"gitHead":"7206850bacf992e3114b8682736c0b8206af6919","scripts":{"lint":"eslint .","test":"nyc _mocha test --exit --require test/setup.js --recursive --timeout 30000","enforce":"nyc check-coverage","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","version:commit":"git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md'","changelog:major":"changelog -M","changelog:minor":"changelog -m","changelog:patch":"changelog -p"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1cd720bc-744d-4b3f-9145-ba0db9dfe760"}},"overrides":{"bookshelf":{"knex":"^3.1.0"}},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"11.6.2","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"20.17.0","dependencies":{"rimraf":"^6.0.1","object-hash":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"qs":"^6.13.0","joi":"^17.13.3","nyc":"^14.1.1","chai":"4.5.0","knex":"^3.1.0","mocha":"^10.7.3","redis":"^4.7.0","eslint":"8.57.0","sqlite3":"^5.1.7","bookshelf":"^1.2.0","@hapi/hapi":"^21.3.10","eslint-config-lob":"^6.0.0","hapi-query-filter":"^5.0.0","generate-changelog":"^1.8.0"},"peerDependencies":{"joi":"^17.13.3","bookshelf":">=1.2.0","@hapi/hapi":"^21.3.10"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count_5.1.0_1762967195473_0.18418562506833558","host":"s3://npm-registry-packages-npm-production"}},"5.1.1":{"name":"hapi-bookshelf-total-count","version":"5.1.1","keywords":["hapi","bookshelf","count"],"author":"","license":"MIT","_id":"hapi-bookshelf-total-count@5.1.1","maintainers":[{"name":"siddharthpant92","email":"siddharth.pant@lob.com"},{"name":"lob-owner","email":"lob.npm.owner@lob.com"},{"name":"barnabygo","email":"barnaby.go@lob.com"},{"name":"team.platform.lob.com","email":"team.platform@lob.com"},{"name":"kplob","email":"ken.pflum@lob.com"},{"name":"vmangwani","email":"vmangwani@lob.com"},{"name":"nathanielwaldschmidtlob","email":"nathaniel.waldschmidt@lob.com"},{"name":"andrew.guterres","email":"andrew.guterres@lob.com"},{"name":"mmorgan-lob","email":"michael.morgan@lob.com"},{"name":"vikita.bhandari","email":"vikita.bhandari@lob.com"},{"name":"lobstertroy","email":"troy.armstrong@lob.com"},{"name":"hunteryoakum","email":"hunter.yoakum@lob.com"},{"name":"erik.forsman-lob","email":"erik.forsman@lob.com"},{"name":"joemeers82","email":"joemeers82@gmail.com"},{"name":"matthew.burke","email":"matthew.burke@lob.com"},{"name":"kjones_lob","email":"kevin.jones@lob.com"},{"name":"manojgowda27","email":"c_manoj.gowda@lob.com"},{"name":"rromit.lob","email":"rishabh.romit@lob.com"},{"name":"tanya.sah","email":"tanya.sah@lob.com"},{"name":"jayteelob","email":"jaytee.sanchez@lob.com"},{"name":"stackptr","email":"corey.johns@lob.com"},{"name":"hpelletier","email":"haley.pelletier@lob.com"},{"name":"douglaje","email":"james.douglas@lob.com"},{"name":"jgarderes-lob","email":"javier.garderes@lob.com"},{"name":"wmorgensternlob","email":"werner.morgenstern@lob.com"},{"name":"derekprovance-lob","email":"derek.provance@lob.com"},{"name":"connietiet","email":"connie.tiet@lob.com"},{"name":"clericuzzi-lob","email":"pedro.clericuzzi@lob.com"},{"name":"lighta","email":"aaron.light@lob.com"},{"name":"karrissa-lob","email":"karrissa.volcy@lob.com"},{"name":"nataliemolina","email":"natalie.molina@lob.com"},{"name":"samkitsheth","email":"samkit.sheth@lob.com"},{"name":"s551364","email":"faissal.shabani@lob.com"},{"name":"wjia","email":"wei.jia@lob.com"},{"name":"lobnan","email":"adnan.shoukfeh@lob.com"},{"name":"dilling-lob","email":"david.illing@lob.com"},{"name":"philthelobster","email":"phil.switzer@lob.com"},{"name":"olaotangeorge","email":"olaotan.george@lob.com"},{"name":"mathiaswolf","email":"mathias.g.wolf@gmail.com"},{"name":"sammelero","email":"sam.melero@lob.com"},{"name":"senftleber-lob","email":"michael.senftleber@lob.com"},{"name":"ryanlob","email":"ryan.williams@lob.com"}],"homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"nyc":{"lines":100,"branches":100,"reporter":["lcov","text-summary"],"functions":100,"statements":100},"dist":{"shasum":"e2015d28a2893f79048d3a26082444fe91e35e56","tarball":"https://registry.npmjs.org/hapi-bookshelf-total-count/-/hapi-bookshelf-total-count-5.1.1.tgz","fileCount":9,"integrity":"sha512-qCZepna81NQPxjHI8B98CxPDI/VSI/iKbKEBvDAwpjPPqKc3h6IpEA0CWVWKdneSiR4PQWRsx51Uwr+Wdlr9uA==","signatures":[{"sig":"MEUCIBjR+FtjVwnmm16sWl/xM4UO+j29g7x7BbiDTWWqTjp8AiEAvEBCeBKKuoBF8nGDYHvJHNPYekKTxAUIekwQopP1Jqs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/hapi-bookshelf-total-count@5.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16465},"main":"lib/index.js","engines":{"npm":">=11.5.1","node":">=24.19.0"},"gitHead":"b9e940b3b49ea55cc72acd4dec13cd4926348a65","scripts":{"lint":"eslint .","test":"nyc mocha test --exit --require test/setup.js --recursive --timeout 30000","enforce":"nyc check-coverage","test:raw":"mocha test --require test/setup.js --recursive --timeout 30000","changelog:major":"changelog -M","changelog:minor":"changelog -m","changelog:patch":"changelog -p"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1cd720bc-744d-4b3f-9145-ba0db9dfe760"}},"overrides":{"bookshelf":{"knex":"^3.1.0"}},"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"_npmVersion":"11.19.1","description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","directories":{},"_nodeVersion":"24.19.0","dependencies":{"rimraf":"^6.0.1","object-hash":"^1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"qs":"^6.13.0","joi":"^17.13.3","nyc":"^18.0.0","chai":"4.5.0","knex":"^3.1.0","mocha":"^12.0.0","redis":"^4.7.0","eslint":"8.57.0","sqlite3":"^6.0.1","bookshelf":"^1.2.0","@hapi/hapi":"^21.3.10","eslint-config-lob":"^6.0.0","hapi-query-filter":"^5.0.0","generate-changelog":"^1.8.0"},"peerDependencies":{"joi":"^17.13.3","bookshelf":">=1.2.0","@hapi/hapi":"^21.3.10"},"_npmOperationalInternal":{"tmp":"tmp/hapi-bookshelf-total-count_5.1.1_1788547051854_0.16110878489487468","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2016-04-07T22:43:22.865Z","modified":"2026-09-24T17:28:05.870Z","1.0.0":"2016-04-07T22:43:22.865Z","2.0.0":"2016-06-20T23:21:18.542Z","3.0.0":"2016-09-22T14:50:30.640Z","4.0.0":"2016-10-31T18:46:13.670Z","4.1.0":"2018-09-18T04:24:17.914Z","4.3.0":"2019-07-24T17:37:38.129Z","5.0.0":"2024-09-17T17:26:20.292Z","5.1.0":"2025-11-12T17:06:35.652Z","5.1.1":"2026-09-04T18:37:31.990Z"},"bugs":{"url":"https://github.com/lob/hapi-bookshelf-total-count/issues"},"license":"MIT","homepage":"https://github.com/lob/hapi-bookshelf-total-count#readme","keywords":["hapi","bookshelf","count"],"repository":{"url":"git+https://github.com/lob/hapi-bookshelf-total-count.git","type":"git"},"description":"Hapi plugin used with Bookshelf models to calculate the total number of records that match a query and appends it to the response","maintainers":[{"email":"siddharth.pant@lob.com","name":"siddharthpant92"},{"email":"lob.npm.owner@lob.com","name":"lob-owner"},{"email":"barnaby.go@lob.com","name":"barnabygo"},{"email":"team.platform@lob.com","name":"team.platform.lob.com"},{"email":"ken.pflum@lob.com","name":"kplob"},{"email":"vmangwani@lob.com","name":"vmangwani"},{"email":"nathaniel.waldschmidt@lob.com","name":"nathanielwaldschmidtlob"},{"email":"andrew.guterres@lob.com","name":"andrew.guterres"},{"email":"michael.morgan@lob.com","name":"mmorgan-lob"},{"email":"vikita.bhandari@lob.com","name":"vikita.bhandari"},{"email":"troy.armstrong@lob.com","name":"lobstertroy"},{"email":"hunter.yoakum@lob.com","name":"hunteryoakum"},{"email":"erik.forsman@lob.com","name":"erik.forsman-lob"},{"email":"joemeers82@gmail.com","name":"joemeers82"},{"email":"matthew.burke@lob.com","name":"matthew.burke"},{"email":"kevin.jones@lob.com","name":"kjones_lob"},{"email":"c_manoj.gowda@lob.com","name":"manojgowda27"},{"email":"rishabh.romit@lob.com","name":"rromit.lob"},{"email":"tanya.sah@lob.com","name":"tanya.sah"},{"email":"jaytee.sanchez@lob.com","name":"jayteelob"},{"email":"corey.johns@lob.com","name":"stackptr"},{"email":"haley.pelletier@lob.com","name":"hpelletier"},{"email":"james.douglas@lob.com","name":"douglaje"},{"email":"javier.garderes@lob.com","name":"jgarderes-lob"},{"email":"werner.morgenstern@lob.com","name":"wmorgensternlob"},{"email":"derek.provance@lob.com","name":"derekprovance-lob"},{"email":"connie.tiet@lob.com","name":"connietiet"},{"email":"pedro.clericuzzi@lob.com","name":"clericuzzi-lob"},{"email":"aaron.light@lob.com","name":"lighta"},{"email":"karrissa.volcy@lob.com","name":"karrissa-lob"},{"email":"natalie.molina@lob.com","name":"nataliemolina"},{"email":"samkit.sheth@lob.com","name":"samkitsheth"},{"email":"faissal.shabani@lob.com","name":"s551364"},{"email":"matias.ribichich@lob.com","name":"mribichich-lob"},{"email":"wei.jia@lob.com","name":"wjia"},{"email":"jeffrey.hage@lob.com","name":"jeff-h-lob"},{"email":"adnan.shoukfeh@lob.com","name":"lobnan"},{"email":"david.illing@lob.com","name":"dilling-lob"},{"email":"phil.switzer@lob.com","name":"philthelobster"},{"email":"olaotan.george@lob.com","name":"olaotangeorge"},{"email":"mathias.g.wolf@gmail.com","name":"mathiaswolf"},{"email":"sam.melero@lob.com","name":"sammelero"},{"email":"michael.senftleber@lob.com","name":"senftleber-lob"},{"email":"ryan.williams@lob.com","name":"ryanlob"}],"readme":"# Hapi Bookshelf Total Count\n\nA [Hapi](http://hapijs.com/) plugin used with [Bookshelf](http://bookshelfjs.org/) models to calculate the total number of records that match a query and appends it to the response. It can be used to calculate an [absolute total count](#absolute-total-count) or a [filtered total count](#filtered-total-count).\n\n## Absolute Total Count\n\nAppends the `total_count` of all instances of the model when the query contains `include[]=total_count`, regardless of query filter.\n\n### Register the Plugin\n\n```js\nconst Hapi = require('hapi');\n\nconst server = new Hapi.Server();\n\nserver.register([\n  require('hapi-bookshelf-total-count')\n], (err) => {\n\n});\n```\n\n### Configure the endpoint\n\n```js\nconst Bookshelf = require('bookshelf')(require('knex')(config));\n\nconst Book = Bookshelf.Model.extend({ tableName: 'books' });\n\nserver.route({\n  method: 'GET',\n  path: '/books',\n  config: {\n    plugins: {\n      totalCount: { model: Book }\n    },\n    handler: (request, reply) => {\n      return new Book().fetchAll()\n      .then((books) => {\n        reply({ data: books });\n      });\n    }\n  }\n});\n```\n\n### Request\n\n```bash\n$ curl -g GET \"https://YOUR_DOMAIN/books?include[]=total_count\"\n```\n\n### Response\n\n```\n{\n  \"data\": [...],\n  \"total_count\": 100\n}\n```\n\n## Filtered Total Count\n\nAppends the `total_count` of a subset of model instances that match a query filter when the query contains `include[]=total_count`. In order to calculate a filtered `total_count`, you'll need to use this plugin in conjunction with [hapi-query-filter](https://github.com/lob/hapi-query-filter) and define a `filter` function on each model that will be filtered. The model's `filter` function is intended to be reused by the list endpoint.\n\n### Register the Plugin\n\n```js\nconst Hapi = require('hapi');\n\nconst server = new Hapi.Server();\n\nserver.register([\n  require('hapi-bookshelf-total-count'),\n  {\n    register: require('hapi-query-filter'),\n    options: { ignoredKeys: ['include'] }\n  }\n], (err) => {\n\n});\n```\n\n### Define a filter function on the model\n\n```js\n// models/book.js\n\nconst Bookshelf = require('bookshelf')(require('knex')(config));\n\nmodule.exports = Bookshelf.Model.extend({\n  tableName: 'books'\n  /**\n   * @param {Object} filter - from request.query.filter\n   * @param {Object} [credentials] - from request.auth.credentials\n   * You may add any additional parameters after filter and credentials\n   */\n  filter: function (filter, credentials) {\n    return this.query((qb) => {\n      qb.where('deleted', false);\n\n      if (filter.year) {\n        qb.where('year', filter.year);\n      }\n    });\n  }\n});\n```\n\n### Configure the endpoint\n\n```js\nconst Book = require('../models/book');\n\nserver.route({\n  method: 'GET',\n  path: '/books',\n  config: {\n    plugins: {\n      queryFilter: { enabled: true },\n      totalCount: { model: Book }\n    },\n    handler: (request, reply) => {\n      return new Book().filter(request.query.filter, request.auth.credentials)\n      .fetchAll()\n      .then((books) => {\n        reply({ data: books });\n      });\n    }\n  }\n});\n```\n\n### Request\n\n```bash\n$ curl -g GET \"https://YOUR_DOMAIN/books?year=1984&include[]=total_count\"\n```\n\n### Response\n\n```\n{\n  \"data\": [...],\n  \"total_count\": 20\n}\n```\n\n## Approximate Total Count\n\nAppends the `approximate_count` which is a cached total count. Currently only Redis is supported as a cache. Both\nrequests that fetch the `total_count` and `approximate_count` will prime the cache.\n\n### Register the Plugin\n\n```js\nconst Bluebird = require('bluebird');\nconst Hapi     = require('hapi');\nconst Redis    = require('redis');\n\nBluebird.promisifyAll(Redis.RedisClient.prototype);\nBluebird.promisifyAll(Redis.Multi.prototype);\n\nconst RedisClient = Redis.createClient({\n  port: '6379',\n  host: 'localhost'\n});\n\nconst server = new Hapi.Server();\n\nserver.register([\n  {\n    register: require('hapi-bookshelf-total-count'),\n    options: {\n      redisClient: RedisClient,\n      ttl: (count) => count / 10, // a function which returns the TTL to set for the cached approximate count\n      uniqueKey: (request) => request.auth.credentials.api_key // an optional function to add additional uniqueness to the cache key\n    }\n  }\n], (err) => {\n\n});\n```\n\n### Define a filter function on the model\n\n```js\n// models/book.js\n\nconst Bookshelf = require('bookshelf')(require('knex')(config));\n\nmodule.exports = Bookshelf.Model.extend({\n  tableName: 'books'\n  /**\n   * @param {Object} filter - from request.query.filter\n   * @param {Object} [credentials] - from request.auth.credentials\n   * You may add any additional parameters after filter and credentials\n   */\n  filter: function (filter, credentials) {\n    return this.query((qb) => {\n      qb.where('deleted', false);\n\n      if (filter.year) {\n        qb.where('year', filter.year);\n      }\n    });\n  }\n});\n```\n\n### Configure the endpoint\n\n```js\nconst Book = require('../models/book');\n\nserver.route({\n  method: 'GET',\n  path: '/books',\n  config: {\n    plugins: {\n      queryFilter: { enabled: true },\n      totalCount: { model: Book }\n    },\n    handler: (request, reply) => {\n      return new Book().filter(request.query.filter, request.auth.credentials)\n      .fetchAll()\n      .then((books) => {\n        reply({ data: books });\n      });\n    }\n  }\n});\n```\n\n### include option - use this option to restrict counting to only the included items in the list\n\n```js\nconst Book = require('../models/book');\n\nserver.route({\n  method: 'GET',\n  path: '/books',\n  config: {\n    plugins: {\n      queryFilter: { enabled: true },\n      totalCount: { \n        include: ['approximate'],\n        model: Book \n      }\n    },\n    handler: (request, reply) => {\n      return new Book().filter(request.query.filter, request.auth.credentials)\n      .fetchAll()\n      .then((books) => {\n        reply({ data: books });\n      });\n    }\n  }\n});\n```\n\n### Request\n\n```bash\n$ curl -g GET \"https://YOUR_DOMAIN/books?year=1984&include[]=approximate_count\"\n```\n\n### Response\n\n```\n{\n  \"data\": [...],\n  \"approximate_count\": 20\n}\n```\n","readmeFilename":"README.md"}