{"name":"dint","version":"5.1.0","description":"Generate and verify directory integrity","main":"index.js","scripts":{"test":"preview && node test","md":"mos"},"repository":{"type":"git","url":"git+https://github.com/zkochan/dint.git"},"keywords":["integrity","sri","directory","fs"],"author":{"name":"Zoltan Kochan","email":"z@kochan.io","url":"https://kochan.io"},"license":"MIT","bugs":{"url":"https://github.com/zkochan/dint/issues"},"homepage":"https://github.com/zkochan/dint#readme","dependencies":{"p-every":"^2.0.0","p-limit":"^3.0.0","ssri":"^8.0.0"},"devDependencies":{"mos":"^2.0.0-alpha.3","mos-plugin-readme":"^1.0.4","package-preview":"^3.0.0","tape":"^5.0.0"},"mos":{"plugins":["readme"],"installation":{"useShortAlias":true}},"engines":{"node":">=10"},"gitHead":"2aea28b01c13614ff9c467275da1dcbb3b1d8724","_id":"dint@5.1.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","dist":{"integrity":"sha512-7q0fKffByWbkDpyR199bSyvRdV6zt6ECiFANh93tnUeLMAGKiKP2eyTMGn0QvUNm/f6VKmhPGzIKWa++k8WFow==","shasum":"3fd62de237ca9aeb630f5a2e6028c9543e16fc98","tarball":"http://registry-npm.ywwl.com/dint/download/dint-5.1.0.tgz","fileCount":4,"unpackedSize":6090,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJdhuCRA9TVsSAnZWagAARH4QAJRt8Bw/D138SJJLHkSN\nl86GoRECVi86+h2AqpPx2GDILugAG2acdZMsIY/uL82Ft5HAoOUlg7TTDQZC\nEoUBsCOfc74V7fyUf5cMS4z5Dehv12KN6dMLkhPWG4zoMbdgJXLXOxDKJPP8\ndzCDkKoOb+hq5yU7sCls9nYa1yU6FJWu4PHeZ4gyugIGOG1B8224KUXxjl0M\nNc+H36I0vvsoF7TJGRGRFhSP+WUj5/r7dSsTThV5TNakjXf/lcZJ6IbN3F9S\nqYfcmyDNQadrW+S58zpSCvz+jOz2z3iqXwqpQrHcyJAQ+S5duPSXAuwFT2ya\nGESmiiOeg2X5pwBRMO/3LEEglyx26QzIh1y8s+K/AKJ7/ugwR7kuEzGGHZwN\n30RjzIW5/WTxaD9V+dapq9x6SeNIec2yNg3laqLSi/Bb0ZR9Z7sZhMdc39Hr\nCrtgTOWseBfkLllHoGB0dBCwFpLfciqdXHpPyEOm8/7fWHoSWnitq4hZ3ylW\nAavSRYpVUNGnX3peLSNYoPe+kDAveAlSNw6cyKvO3b7BcRFitlXn2BTmWU7p\nrFyaNyyiodSrIOU6sm7jWRQzNOmrZB1f6d/U/+dwS6IM9nxixLkwZB3R9PVV\nES0NxlHWPncorVt1RQXLd2KUkVCmdQe4mCTofBw68/+qL19G6pnpOLj9Dnro\n1SAH\r\n=Rx0k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5dvYIqfuAZiIRL1eiPZvHmSYiBFFIZMd10aZuJZNN/gIhAJuHygVuHG71PmTjJfHc6tbvJKGN9OjRskIfqVQrCXhu"}],"size":2781,"noattachment":false,"key":"/dint/-/dint-5.1.0.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"z@kochan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dint_5.1.0_1613092974046_0.4346922594583953"},"_hasShrinkwrap":false,"readme":"# dint\n\n> Generate and verify directory integrity\n\n<!--@shields('npm', 'travis')-->\n[![npm version](https://img.shields.io/npm/v/dint.svg)](https://www.npmjs.com/package/dint) [![Build Status](https://img.shields.io/travis/zkochan/dint/master.svg)](https://travis-ci.org/zkochan/dint)\n<!--/@-->\n\nThis package is mostly a copy/paste from [@zkat](https://github.com/zkat)'s [cadr](https://github.com/zkat/cadr) excluding the [cacache](https://github.com/zkat/cacache) usages.\n\n**Important!** A directory is not considered modified if a file was added.\nA directory is considered modified if a file was modified or removed.\n\n## Installation\n\n```sh\nnpm i -S dint\n```\n\n## API\n\n### `from(dirname): Promise<DirectoryIntegrity>`\n\nReturns a mapping of file names to size and [Subresource Integrity](https://w3c.github.io/webappsec-subresource-integrity/) of each file.\n\nResult example:\n\n```js\n{\n 'test/fixtures/4/lib/bar.js':\n   { generatingIntegrity: Promise<'sha512-1B0QjibzjRrYeSf79Hcy9T1t8KNt4cFpz//88geXTN6lDnUzMo+4o/MJDESUs884XdZ5EX4RLdzsJA8qeEV3lg=='>,\n     size: 198 },\n  'test/index.js':\n   { generatingIntegrity: Promise<'sha512-X6ypBcefaTDbDHHcR0J57E2dvDv6vAVi7tHAhfDImmDU8LBaYwdkdX+hVlqFdWNevJjRqsgZbXb/c+Ewq5t3tQ=='>,\n     size: 939 } }\n```\n\n### `check(dirname, directoryIntegrity): Promise<Boolean>`\n\nVerifies directory integrity against a `directoryIntegrity` argument.\n\nE.g.:\n\n```js\ncheck('dirname', {\n 'test/fixtures/4/lib/bar.js':\n   { integrity: 'sha512-1B0QjibzjRrYeSf79Hcy9T1t8KNt4cFpz//88geXTN6lDnUzMo+4o/MJDESUs884XdZ5EX4RLdzsJA8qeEV3lg==',\n     size: 198 },\n  'test/index.js':\n   { integrity: 'sha512-X6ypBcefaTDbDHHcR0J57E2dvDv6vAVi7tHAhfDImmDU8LBaYwdkdX+hVlqFdWNevJjRqsgZbXb/c+Ewq5t3tQ==',\n     size: 939 } })\n```\n\n## License\n\n[MIT](./LICENSE) © [Zoltan Kochan](http://kochan.io)\n","publish_time":1613092974214,"_cnpm_publish_time":1613092974214,"dist-tags":{"latest":"5.1.0","next":"5.0.0"}}