Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dint

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dint

Generate and verify directory integrity

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
367
decreased by-58.34%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 14 Jun 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc