JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 82611
  • Score
    100M100P100Q156643F
  • License MIT

return an sha1sum of a given file

Package Exports

  • sha1-file

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sha1-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sha1-file

Overview

Simply return an sha1 sum of a given file.

Installation

$ npm install sha1-file

API

Sync:

sha1File(path)

var sha1File = require('sha1-file');

sha1File('path/to/a_file'); // '18e904aae79b5642ed7975c0a0074936'

Async:

sha1File(path, callback, [strict])

If strict is true and there is an error it will throw it, otherwise it will pass an error string through the callback.

sha1File.async('./README.md', function (data) {
  console.log(data);
});

sha1File.async('./README.md', function (data) {
  console.log(data);
}, true);

// errors

// non-strict: will pass through an error to `data`
sha1File.async('./null', function (data) {
  console.log(data);
});

// strict: will throw an error
sha1File.async('./null', function (data) {
  console.log(data);
}, true);