{"_id":"@conorpai/tilestrata-disk","_rev":"4-c8b14a44167f6e345bce171d1957a6c6","name":"@conorpai/tilestrata-disk","dist-tags":{"latest":"0.5.4"},"versions":{"0.5.1":{"name":"@conorpai/tilestrata-disk","version":"0.5.1","description":"A TileStrata plugin for reading/writing tiles from the filesystem","author":{"name":"Brian Reavis","email":"brian@naturalatlas.com"},"license":"Apache-2.0","main":"index.js","scripts":{"test-ci":"mocha -R tap","test":"mocha -R list"},"repository":{"type":"git","url":"git+https://github.com/ConorPai/tilestrata-disk.git"},"keywords":["tilestrata","tilestrata-plugin","tilestrata-provider","tilestrata-cache"],"bugs":{"url":"https://github.com/ConorPai/tilestrata-disk/issues"},"homepage":"https://github.com/ConorPai/tilestrata-disk","dependencies":{"fs-extra":"^0.13.0","mime":"^1.3.4"},"devDependencies":{"chai":"^1.10.0","mocha":"^2.0.1"},"peerDependencies":{"tilestrata":"*"},"publishConfig":{"access":"public"},"gitHead":"477ca10df6a139f46cb2f4433e3262c7b7562cf2","_id":"@conorpai/tilestrata-disk@0.5.1","_nodeVersion":"14.17.5","_npmVersion":"7.20.6","dist":{"integrity":"sha512-g2d/v0HUJ+iWhP4FPvhI9RNLp2JJOpbp+98NIM92GFiXCUBOrmgBlfwv2JaEWbGiLqlAVT1sY2mTO0XlR38b8A==","shasum":"48cb2069f0d2177137cbb22c413a030e987b7cd8","tarball":"https://registry.npmjs.org/@conorpai/tilestrata-disk/-/tilestrata-disk-0.5.1.tgz","fileCount":14,"unpackedSize":34351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhH0jiCRA9TVsSAnZWagAA47YP/RbKc6XzhkrwZEH8I9Cs\neQuDW5enG8foDGFuxlqAxwKZ13oZMHMoMIti0jSoE5/aNMQLG2wPxaFFOysZ\noaDXFETHHPqDfSEGWjdXqbVrAiFdugKutio61aeOYPbgrGytHyn5m3uMyE7T\n3PE9TCaJK1eKPIJGKHZKfKfeLtvmOgsXHeTwwb5W9t6AXuoEc5hwGx358D4S\n1jQGOCmjMqkMBa6x0sD08iXPB3GtkGJUHf/EVIM5hPx9SY8WZpatSBz32Qvs\niE09sv4nAywMMCEnn1uK7g8/t4QiMvsK4Cl8TrgcGzlFXRc4Noi19WK+sm1G\nOrjbxTvJBvsWUx9x1N+d3IH9hW6tv9eozXk9eClVeVrJkDcfKhCqvKRIZYrF\nCEOdisjUvGrUEyu/fskhEHhOJjQm6V/VprLCMkJq3geZt8/7wI70jiZdh8bW\nfKM+mpncZ92M2FQDl3er/jpforvZErLMfhZaPMuL0hC0gTiN9GzCAqB6HNc9\nZMSU0VWNQN3H8q965IRMRa0zML3Eob8m4WWMhQ3hs9hgMJoUvwdizsnJ6jnc\nuKLPV6uYK6SVTs85skJ4zzExVbsa6lQC51WfWVU96GTLgEwt2iomGQ9OEW3u\npTSRyLknzqcGBpfnFrPspnVA/f/W1f3ELeG/Oqzs8CX43D2FFaiYA7ZDUhS2\nvU5l\r\n=g/M7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAOl1o5u+crxyjJgjvZnCUCMgQU6veBVV09rhdqjpPVQIgDRbUs0DJuP7uezyJ5qpsIWyZEufz60ZmY69eXnFRaHM="}]},"_npmUser":{"name":"conorpai","email":"baiguangnan@163.com"},"directories":{},"maintainers":[{"name":"conorpai","email":"baiguangnan@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tilestrata-disk_0.5.1_1629440226386_0.15917996971171378"},"_hasShrinkwrap":false},"0.5.2":{"name":"@conorpai/tilestrata-disk","version":"0.5.2","description":"A TileStrata plugin for reading/writing tiles from the filesystem","author":{"name":"Brian Reavis","email":"brian@naturalatlas.com"},"license":"Apache-2.0","main":"index.js","scripts":{"test-ci":"mocha -R tap","test":"mocha -R list"},"repository":{"type":"git","url":"git+https://github.com/ConorPai/tilestrata-disk.git"},"keywords":["tilestrata","tilestrata-plugin","tilestrata-provider","tilestrata-cache"],"bugs":{"url":"https://github.com/ConorPai/tilestrata-disk/issues"},"homepage":"https://github.com/ConorPai/tilestrata-disk","dependencies":{"fs-extra":"^0.13.0","mime":"^1.3.4"},"devDependencies":{"chai":"^1.10.0","mocha":"^2.0.1"},"peerDependencies":{"tilestrata":"*"},"publishConfig":{"access":"public"},"gitHead":"477ca10df6a139f46cb2f4433e3262c7b7562cf2","_id":"@conorpai/tilestrata-disk@0.5.2","_nodeVersion":"14.17.5","_npmVersion":"7.20.6","dist":{"integrity":"sha512-7WoKEe7raNfJndKEy5LnJrMLMO9tB1m4Vlj84xJqGUZb08DpF8hDgjwCxqMfvPajHzwFZ99BMDNSdzOVyf20bg==","shasum":"0ac328b55c565e53df44aa3ec36608bd93baa203","tarball":"https://registry.npmjs.org/@conorpai/tilestrata-disk/-/tilestrata-disk-0.5.2.tgz","fileCount":14,"unpackedSize":34517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJdm8CRA9TVsSAnZWagAAhusP/1uMEWeyQV1x4KslKjIr\nyH06K/IxKwDnR/CxYi0chfxLLyB7y/uX1cpNCnsXcxOyiyk24w9Prhmv9KOo\nIxqmPzYZzqD9TiqZ5gqXTFim05FPByTrkNUQ4eDGz+t+mJmo0oNy+M/2tker\nx0t0UCUb55JkhbC0oqiA0/2XHW9NqC0FY5QhKrCL460WR7bX4pdh0MiaGz5R\n1IMPxdrES5BhIjEb1uUlbBolpbEVt3e49pXrGZy9+nnZENd2sAYbOtPB4rg0\nDnt7FyRldLv1fN8BAYbc05UWxgIqTOsEsoz0KD90nt7fSKtwhrzXkQlXm2qQ\ntvpLkDy+Qtd/ZJOqh1PYQbpOLXmn1GSqjSArGXG/l3DONZMfa58w3YC1y1eF\nfQ8wxag/qus+4QaWrtgzWkT5CfMgU6VNvS12vxSl8oUZxCzz7qYf1u9UFFBA\nF29sGZvf5YgEI77JS/1iP0hwe+T69kLkg38nTZicJtmSNsq0FoIOe49at7WV\n8U1G3VAEJw97gTfSsmipQiPJ0UU641JiPkBV3/Lo2WIsmORLAMrBkz8xAgR3\ndmLzPQk4I/40E6cVId4mr2N68Mn96W8VGDVPDohmqzNQcnPuytJX0FItNkL+\n2ku0eIkAGHlCsQBGQn3gnILfVTaqq+R9y6lSug5rRk7sTjqrzdD9K67oqO/m\nNmrX\r\n=MofA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVzXhu5zt8XMyc0QEqNOL4e4KMkuUtvZYJD5gDQqPiOAiEAlQgpJ8IgAS7e+GVrSfXG0NfXBzriHNr3+MQ4riNNjgY="}]},"_npmUser":{"name":"conorpai","email":"baiguangnan@163.com"},"directories":{},"maintainers":[{"name":"conorpai","email":"baiguangnan@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tilestrata-disk_0.5.2_1629870523967_0.8945141136686483"},"_hasShrinkwrap":false},"0.5.3":{"name":"@conorpai/tilestrata-disk","version":"0.5.3","description":"A TileStrata plugin for reading/writing tiles from the filesystem","author":{"name":"Brian Reavis","email":"brian@naturalatlas.com"},"license":"Apache-2.0","main":"index.js","scripts":{"test-ci":"mocha -R tap","test":"mocha -R list"},"repository":{"type":"git","url":"git+https://github.com/ConorPai/tilestrata-disk.git"},"keywords":["tilestrata","tilestrata-plugin","tilestrata-provider","tilestrata-cache"],"bugs":{"url":"https://github.com/ConorPai/tilestrata-disk/issues"},"homepage":"https://github.com/ConorPai/tilestrata-disk","dependencies":{"fs-extra":"^0.13.0","mime":"^1.3.4"},"devDependencies":{"chai":"^1.10.0","mocha":"^2.0.1"},"peerDependencies":{"tilestrata":"*"},"publishConfig":{"access":"public"},"gitHead":"26fa571dca2fab37c5bc28c3f48173a2c1ba4dd0","_id":"@conorpai/tilestrata-disk@0.5.3","_nodeVersion":"14.17.5","_npmVersion":"7.20.6","dist":{"integrity":"sha512-8H9a7fSZVqlq4TB2ijZ/unFXkQz9kFiRmcf6mIhcwjBV4Qty4y75zQ4SIVZUQxuQpqF/KdSd3xkoq2SrckyBgA==","shasum":"f76bb7371821e8e71ee8455d0999ca425d71aac1","tarball":"https://registry.npmjs.org/@conorpai/tilestrata-disk/-/tilestrata-disk-0.5.3.tgz","fileCount":14,"unpackedSize":34531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJeICCRA9TVsSAnZWagAAEP0P/2yO6MjMG54Mt0XFuK8Y\nCy59cFXCo6rpGzzxqAFeBLtBoiYBVM0hxOhj30TrmXgpFaxlS5nlFv9Mytkq\nVZv/sV/Qfzw45f3EKuGJ3UERZit4QJQtntRn4Lwlo8goEgZ3n+cM39cqO1z/\nZDenPvcrHHd3+ww7f88VuFonxtBWKRvChNuqy0nb/4bzU8relFMqs8JKFDsC\nFclX69hHm+7LfYvAa+n5giCF+Fm1lAotqp2UK1J/i51udqPeoTrWWrVstDPT\ndDmfKuGUCQ23NPmEfbspGr5VN4YyFR2FacRhu2OFr4uG03oLnPMzJPQ91LiL\nb4tJspBTowosFMOJAq+GZDyMOHMhS5zotsppJ0I03TY101/Lwd0lh9Ah6ZXC\nMkv7qw80qDiy4lV1akFeGKHb8V+tCVAUik1+oSRdP4vx/U6fKIr9cjzARwhR\nM6Co6+ZnnRmOdFa9/c1FHJYwqnBl5J7LxCDPEg6g+1FAgoLPHArsIRsS2CdN\n2gNV+HsdC1rrueFflPYMmD+H0zq1FXIB/NBtQCbQlgqKZetBGJYcMi4aWBfp\n+ICi1Onj30Tye/TcNXCoUHqrMURTGBHIABdXyPp3ZWA2cSiQ5yTv/lVTS5d6\nXgR3Dv3daXwKgxdpT8+aB7nfdlTWASlehM/ZIjqrA3nrmqnrpq7S6jY0wa3t\nZKWZ\r\n=NSiT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtu5Dnu8uIJ+PbjNuTt4kELZnDnjInVeYJJ/jlJSiyEQIhAIxds1jRsecyA7wwFJkRqikIY4n+RSgoK+rUBwItAaVH"}]},"_npmUser":{"name":"conorpai","email":"baiguangnan@163.com"},"directories":{},"maintainers":[{"name":"conorpai","email":"baiguangnan@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tilestrata-disk_0.5.3_1629872642271_0.3178333623963825"},"_hasShrinkwrap":false},"0.5.4":{"name":"@conorpai/tilestrata-disk","version":"0.5.4","description":"A TileStrata plugin for reading/writing tiles from the filesystem","author":{"name":"Brian Reavis","email":"brian@naturalatlas.com"},"license":"Apache-2.0","main":"index.js","scripts":{"test-ci":"mocha -R tap","test":"mocha -R list"},"repository":{"type":"git","url":"git+https://github.com/ConorPai/tilestrata-disk.git"},"keywords":["tilestrata","tilestrata-plugin","tilestrata-provider","tilestrata-cache"],"bugs":{"url":"https://github.com/ConorPai/tilestrata-disk/issues"},"homepage":"https://github.com/ConorPai/tilestrata-disk","dependencies":{"fs-extra":"^0.13.0","mime":"^1.3.4"},"devDependencies":{"chai":"^1.10.0","mocha":"^2.0.1"},"peerDependencies":{"tilestrata":"*"},"publishConfig":{"access":"public"},"gitHead":"d9649095b2925396af3adc236919143fa33f2998","_id":"@conorpai/tilestrata-disk@0.5.4","_nodeVersion":"14.17.5","_npmVersion":"7.20.6","dist":{"integrity":"sha512-b3TjaSDiwqmKD/7tGBRNqAU29eh3zgu5VJmgKsC0pIto4ZlnOSeU1Ik05PDpjhPLkOWkwkDzTYsF/8v1aviUJw==","shasum":"aa6d7c93d3cd333bf4ef1b8d5046634d42e81dd5","tarball":"https://registry.npmjs.org/@conorpai/tilestrata-disk/-/tilestrata-disk-0.5.4.tgz","fileCount":14,"unpackedSize":34557,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJf53CRA9TVsSAnZWagAAJYoP/1MaCoKkzmBmEkSmRAQ8\ntHIC59T5QOvIe7iUj2L/7YxoL4Bl5Jd6qWPCaPd5f6IHbVIidbOyAkMjZRqD\nUI3QWg8LsxitTLN6frfyr9Bi4wO44/Gybxm+/Jl6V0ZkF50/DfyyjNx2He6o\nr/S6XLf4IDoFxYJ4nyxXPkjxLn4RL0BXlgfiaR6BI/y13zaq1p1gfNyw/B6z\nGQ+hA8lcjQbWZoD0G98HzaDzDhuQmxCn1rdPImQ7O31hLO+pgpHLs5dpArKO\ne+eIWF1+lv1JBuLtP1UvC3WH5A9cfVnDFj0pORUAGmmlo8BIyr1plvIHmSOq\n8R6exRhhiqKfEtlyRdW2A/+xWIDpcBpTJknWix/15tkOm0W7v0zuOD+hcN2C\nuZb3BkVYyEkTIeK8+wvTS98cp7MBZlvJRZ8dLGBwByN0Hl0t7H0xWuN0Pz7t\n4+7JmD5sMjT3470vqWBiSHYoi1MZNddRQi4ZZ/oLCkfb9s+5D5xFbmA3nHA0\nip+qLy5pK668Ze/NkCO7WGhxQ/yKpHMk6PXRH56awd00g/TwDkmu2WwNvFwH\nE69y2ItzR/x4EdnjFb8aqYtc5nXvA9Ht0abytPIj50A+fPnAAfxYp9lz2MTK\nWSDy6tVQiZmGh0iNAjIJxBcJhuwZwhwgNd7ywH2oPYRhgZk/wd4cSf33s4QJ\nNGuW\r\n=+o5y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH1NxSG6kCbeHTQHy3DdLo0++NyQtSajOI1mKkR4g5NACIQCvA07nnyOo2msKwXbAzmnnpVnrEVy/BIrdZQdr8m17Zg=="}]},"_npmUser":{"name":"conorpai","email":"baiguangnan@163.com"},"directories":{},"maintainers":[{"name":"conorpai","email":"baiguangnan@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tilestrata-disk_0.5.4_1629879927588_0.3456508780405103"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-20T06:17:06.328Z","0.5.1":"2021-08-20T06:17:06.757Z","modified":"2022-04-05T00:57:46.182Z","0.5.2":"2021-08-25T05:48:44.211Z","0.5.3":"2021-08-25T06:24:02.432Z","0.5.4":"2021-08-25T08:25:27.734Z"},"maintainers":[{"name":"conorpai","email":"baiguangnan@163.com"}],"description":"A TileStrata plugin for reading/writing tiles from the filesystem","homepage":"https://github.com/ConorPai/tilestrata-disk","keywords":["tilestrata","tilestrata-plugin","tilestrata-provider","tilestrata-cache"],"repository":{"type":"git","url":"git+https://github.com/ConorPai/tilestrata-disk.git"},"author":{"name":"Brian Reavis","email":"brian@naturalatlas.com"},"bugs":{"url":"https://github.com/ConorPai/tilestrata-disk/issues"},"license":"Apache-2.0","readme":"# tilestrata-disk\n[![NPM version](http://img.shields.io/npm/v/tilestrata-disk.svg?style=flat)](https://www.npmjs.org/package/tilestrata-disk)\n[![Build Status](https://travis-ci.org/naturalatlas/tilestrata-disk.svg)](https://travis-ci.org/naturalatlas/tilestrata-disk)\n[![Coverage Status](http://img.shields.io/codecov/c/github/naturalatlas/tilestrata-disk/master.svg?style=flat)](https://codecov.io/github/naturalatlas/tilestrata-disk)\n\nA [TileStrata](https://github.com/naturalatlas/tilestrata) plugin for storing / retrieving tiles from disk. It can either act as a cache or as a provider. When using it for caching, make **sure** to use different directories for each layer (e.g. \"tiles/layer_a\", \"tiles/layer_b\"). If given a `maxage`, it will check the modification time of a tile and return null if it's too old. If `maxage=0`, caching behavior will be completely disabled.\n\n```sh\n$ npm install tilestrata-disk --save\n```\n\n### Sample Usage\n\n```js\nvar disk = require('tilestrata-disk');\n\n// cache: cache tiles to disk\nserver.layer('mylayer').route('tile.png')\n    .use(/* some provider */)\n    .use(disk.cache({dir: './tiles/mylayer'}));\n\n// cache: cache with maxage\nserver.layer('mylayer').route('tile.png')\n    .use(/* some provider */)\n    .use(disk.cache({maxage: 3600, dir: './tiles/mylayer'}));\n\n// cache: cache with maxage function (advanced)\nserver.layer('mylayer').route('tile.png')\n    .use(/* some provider */)\n    .use(disk.cache({\n        dir: './tiles/mylayer',\n        maxage: function(server, req) {\n            if (req.z > 15) return 0; // don't cache\n            if (req.z > 13) return 3600;\n            return 3600*24;\n        }\n    }));\n\n// cache: custom directory layout\nserver.layer('mylayer').route('tile.png')\n    .use(/* some provider */)\n    .use(disk.cache({path: './tiles/{layer}/{z}/{x}/{y}-{filename}'}));\n\n// cache: custom directory layout (via callback)\nserver.layer('mylayer').route('tile.png')\n    .use(/* some provider */)\n    .use(disk.cache({path: function(tile) {\n        return './tiles/' + tile.layer + '/' + tile.z + '/' /* ... */\n    }}));\n```\n```js\n// provider: serve pre-existing / pre-sliced tiles off disk\nserver.layer('mylayer').route('tile.png')\n    .use(disk.provider('/path/to/dir/{z}/{x}/{y}/file.png'));\n```\n\nSome sample values of `maxage` are:\n\n```js\nmaxage: null  // no age checking: permanent caching (default)\nmaxage: 0     // disable cache completely (both reading and writing)\nmaxage: 3600  // one hour\n```\n\n### Advanced Behavior\n\nIf using TileStrata [0.6.0](https://github.com/naturalatlas/tilestrata/releases/tag/v1.6.0) and above, you can also specify a `refreshage` parameter that indicates how old a tile can be before TileStrata should refresh it. This option should be used in conjunction with `maxage`. The purpose is best illustrated by an example:\n\n```js\n.use(disk.cache({\n    dir: './tiles/mylayer',\n    refreshage: 3600, // 1 hour\n    maxage: 3600*24*7 // 1 week\n}));\n```\n\nWith this configuration, if the cache finds a tile that is two days old, it will serve the tile from cache while telling TileStrata to build a new tile in the background for the next person (more info [here](https://github.com/naturalatlas/tilestrata#writing-caches)). Some sample values of `refreshage` are:\n\n```js\nrefreshage: null  // never refresh (default)\nrefreshage: 0     // always refresh in background after hits\nrefreshage: 1800  // half hour\n```\n\n## Contributing\n\nBefore submitting pull requests, please update the [tests](test) and make sure they all pass.\n\n```sh\n$ npm test\n```\n\n## License\n\nCopyright &copy; 2014–2015 [Brian Reavis](https://github.com/brianreavis) & [Contributors](https://github.com/naturalatlas/tilestrata-disk/graphs/contributors)\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","readmeFilename":"README.md"}