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

sha1-file

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

sha1-file

return an sha1sum of a given file

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93K
increased by46.61%
Maintainers
1
Weekly downloads
 
Created
Source

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);

Keywords

FAQs

Package last updated on 26 Nov 2014

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