dint
Generate and verify directory integrity
Last updated 5 years ago by zkochan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dint 
SYNC missed versions from official npm registry.

dint

Generate and verify directory integrity

npm version Build Status

This package is mostly a copy/paste from @zkat's cadr excluding the cacache usages.

Important! A directory is not considered modified if a file was added. A directory is considered modified if a file was modified or removed.

Installation

npm i -S dint

API

from(dirname): Promise<DirectoryIntegrity>

Returns a mapping of file names to size and Subresource Integrity of each file.

Result example:

{
 'test/fixtures/4/lib/bar.js':
   { generatingIntegrity: Promise<'sha512-1B0QjibzjRrYeSf79Hcy9T1t8KNt4cFpz//88geXTN6lDnUzMo+4o/MJDESUs884XdZ5EX4RLdzsJA8qeEV3lg=='>,
     size: 198 },
  'test/index.js':
   { generatingIntegrity: Promise<'sha512-X6ypBcefaTDbDHHcR0J57E2dvDv6vAVi7tHAhfDImmDU8LBaYwdkdX+hVlqFdWNevJjRqsgZbXb/c+Ewq5t3tQ=='>,
     size: 939 } }

check(dirname, directoryIntegrity): Promise<Boolean>

Verifies directory integrity against a directoryIntegrity argument.

E.g.:

check('dirname', {
 'test/fixtures/4/lib/bar.js':
   { integrity: 'sha512-1B0QjibzjRrYeSf79Hcy9T1t8KNt4cFpz//88geXTN6lDnUzMo+4o/MJDESUs884XdZ5EX4RLdzsJA8qeEV3lg==',
     size: 198 },
  'test/index.js':
   { integrity: 'sha512-X6ypBcefaTDbDHHcR0J57E2dvDv6vAVi7tHAhfDImmDU8LBaYwdkdX+hVlqFdWNevJjRqsgZbXb/c+Ewq5t3tQ==',
     size: 939 } })

License

MIT © Zoltan Kochan

Current Tags

  • 5.1.0                                ...           latest (5 years ago)
  • 5.0.0                                ...           next (6 years ago)

13 Versions

  • 5.1.0                                ...           5 years ago
  • 5.0.0                                ...           6 years ago
  • 4.0.2                                ...           6 years ago
  • 4.0.1                                ...           7 years ago
  • 4.0.0                                ...           7 years ago
  • 3.0.2                                ...           8 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 2.0.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 0.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 11
Last Month 1
Dependencies (3)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |