Notorious Party Muppets

    hashdir

    0.0.1 • Public • Published

    hashdir

    NPM version Build Status Coverage Status Dependency Status

    Hashes content in directory and returning object with file structure and hashes (useful in tests)

    Install

    Install with npm:

    npm install --save hashdir

    Example

    var hashdir = require('hashdir');
     
    /* `directory` structure:
    directory/
      folder/
        file2.js
      emptyfolder/
      file1.js
    */
    hashdir('directory', function (err, result) {
        assert.deepEqual(result, {
            'file1.js': 'SHA-1 of file1.js content',
            'folder/file2.js': 'SHA-1 of file2.js content',
            'folder/emptyfolder': undefined,
            'folder/folder': undefined,
        });
    });
     

    API

    hashdir(path[, opts], cb)

    path: path to directory, that you want to be hashed.

    Options: Object, that passed to walk module.

    Callback: function, that recieves error as first argument and result object in second.

    License

    MIT © Vsevolod Strukchinsky

    Keywords

    none

    Install

    npm i hashdir

    DownloadsWeekly Downloads

    5

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • floatdrop