Socket
Socket
Sign inDemoInstall

dint

Package Overview
Dependencies
12
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dint

Generate and verify directory integrity


Version published
Weekly downloads
393
decreased by-13.25%
Maintainers
1
Install size
168 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 14 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc