@cumulus/checksum
Advanced tools
Comparing version 1.22.1 to 1.23.0
{ | ||
"name": "@cumulus/checksum", | ||
"version": "1.22.1", | ||
"version": "1.23.0", | ||
"description": "Cumulus checksum utilities", | ||
@@ -8,7 +8,19 @@ "engines": { | ||
}, | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"./dist/**/*.js", | ||
"./dist/**/*.d.ts" | ||
], | ||
"scripts": { | ||
"test": "ava", | ||
"test-coverage": "nyc ava", | ||
"debug": "NODE_ENV=test node --inspect-brk node_modules/ava/profile.js --serial tests/*.js" | ||
"build-docs": "npm run tsc && ../../node_modules/.bin/jsdoc2md -t templates/README.md.hbs ./dist/*.js > README.md", | ||
"test": "../../node_modules/.bin/ava", | ||
"test-coverage": "../../node_modules/.bin/nyc npm test", | ||
"debug": "NODE_ENV=test node --inspect-brk node_modules/ava/profile.js --serial tests/*.js", | ||
"tsc": "../../node_modules/.bin/tsc", | ||
"prepare": "npm run tsc" | ||
}, | ||
"ava": { | ||
"timeout": "15m" | ||
}, | ||
"nyc": { | ||
@@ -25,2 +37,3 @@ "exclude": [ | ||
}, | ||
"homepage": "https://github.com/nasa/cumulus/tree/master/packages/checksum/README.md", | ||
"repository": { | ||
@@ -35,7 +48,3 @@ "type": "git", | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.1.0", | ||
"nyc": "^14.0.0" | ||
}, | ||
"gitHead": "3afec6cb6b37c3695fe9c78b4c3136f02337563f" | ||
"gitHead": "68df6858844a6cd826d62801c34ae549871ce774" | ||
} |
# @cumulus/checksum | ||
## About Cumulus | ||
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's | ||
future Earth science data streams. | ||
[Cumulus Documentation](https://nasa.github.io/cumulus) | ||
## Checksum | ||
The `@cumulus/checksum` library provides checksum functionality used by Cumulus packages and tasks. | ||
Currently the supported input includes file streams, and supported checksum algorithms include | ||
`cksum` and the algorithms available to the `crypto` package, as documented [here](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options). | ||
The `@cumulus/checksum` library provides checksum functionality used by Cumulus | ||
packages and tasks. Currently the supported input includes file streams, and | ||
supported checksum algorithms include `cksum` and the algorithms available to | ||
the `crypto` package, as documented | ||
[here](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options). | ||
@@ -25,1 +20,51 @@ ## Usage | ||
``` | ||
## API | ||
<a name="module_checksum"></a> | ||
## checksum | ||
* [checksum](#module_checksum) | ||
* [.generateChecksumFromStream(algorithm, stream, [options])](#module_checksum.generateChecksumFromStream) ⇒ <code>Promise.<(number\|string)></code> | ||
* [.validateChecksumFromStream(algorithm, stream, expectedSum, [options])](#module_checksum.validateChecksumFromStream) ⇒ <code>Promise.<boolean></code> | ||
<a name="module_checksum.generateChecksumFromStream"></a> | ||
### checksum.generateChecksumFromStream(algorithm, stream, [options]) ⇒ <code>Promise.<(number\|string)></code> | ||
Create <algorithm> file checksum from readable stream | ||
**Kind**: static method of [<code>checksum</code>](#module_checksum) | ||
**Returns**: <code>Promise.<(number\|string)></code> - the file checksum | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| algorithm | <code>string</code> | Checksum algorithm type | | ||
| stream | <code>stream.Readable</code> | A readable file stream | | ||
| [options] | <code>Object</code> | Checksum options, see `crypto.createHash()` | | ||
<a name="module_checksum.validateChecksumFromStream"></a> | ||
### checksum.validateChecksumFromStream(algorithm, stream, expectedSum, [options]) ⇒ <code>Promise.<boolean></code> | ||
Validate expected checksum against calculated checksum | ||
**Kind**: static method of [<code>checksum</code>](#module_checksum) | ||
**Returns**: <code>Promise.<boolean></code> - whether expectedSum === calculatedSum | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| algorithm | <code>string</code> | Checksum algorithm | | ||
| stream | <code>stream.Readable</code> | A readable file stream | | ||
| expectedSum | <code>number</code> \| <code>string</code> | expected checksum | | ||
| [options] | <code>Object</code> | Checksum options | | ||
## About Cumulus | ||
Cumulus is a cloud-based data ingest, archive, distribution and management | ||
prototype for NASA's future Earth science data streams. | ||
[Cumulus Documentation](https://nasa.github.io/cumulus) | ||
--- | ||
Generated automatically using `npm run build-docs` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
0
70
13628
3
0
1