Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7130e34adb | |||
dba40dc99f | |||
9e0f2ee551 | |||
e28c1c73ea |
@ -26,6 +26,7 @@ mirror:
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
@ -33,24 +34,39 @@ snyk:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
sast:
|
||||
stage: security
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
||||
variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
allow_failure: true
|
||||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
||||
--volume "$PWD:/code"
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
||||
artifacts:
|
||||
reports:
|
||||
sast: gl-sast-report.json
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -62,6 +78,7 @@ testLTS:
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -118,6 +135,7 @@ pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
tags:
|
||||
@ -130,13 +148,3 @@ pages:
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
windowsCompatibility:
|
||||
image: stefanscherer/node-windows:10-build-tools
|
||||
stage: metadata
|
||||
script:
|
||||
- npm install & npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- windows
|
||||
allow_failure: true
|
||||
|
89
README.md
89
README.md
@ -1,36 +1,53 @@
|
||||
# nodehash
|
||||
|
||||
simplifies access to node hash functions. TypeScript Ready
|
||||
|
||||
## Status
|
||||
|
||||
[](https://gitlab.com/pushrocks/nodehash/commits/master)
|
||||
|
||||
## Usage
|
||||
|
||||
We recommend the use of TypeScript for best in class intellisense.
|
||||
|
||||
```typescript
|
||||
import * as nodehash from "nodehash";
|
||||
|
||||
// from stream
|
||||
let readStream = fs.createReadStream("./somefile.txt")
|
||||
nodehash.sha256FromStream(readStream)
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from file
|
||||
nodehash.sha256FromFile("./somefile.txt")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from string
|
||||
nodehash.sha256FromString("some weird random string")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
let hashString = nodehash.sha256FromStringSync("some weird random string");
|
||||
```
|
||||
# @pushrocks/smarthash
|
||||
simplified access to node hash functions
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smarthash)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smarthash)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smarthash)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smarthash/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/smarthash/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smarthash/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smarthash)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smarthash)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
|
||||
We recommend the use of TypeScript for best in class intellisense.
|
||||
|
||||
```typescript
|
||||
import * as nodehash from "nodehash";
|
||||
|
||||
// from stream
|
||||
let readStream = fs.createReadStream("./somefile.txt")
|
||||
nodehash.sha256FromStream(readStream)
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from file
|
||||
nodehash.sha256FromFile("./somefile.txt")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
// from string
|
||||
nodehash.sha256FromString("some weird random string")
|
||||
.then((resultString){
|
||||
console.log(resultString); // prints hash of the file
|
||||
});
|
||||
|
||||
let hashString = nodehash.sha256FromStringSync("some weird random string");
|
||||
```
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
|
@ -1,5 +1,15 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitrepo": "smarthash",
|
||||
"shortDescription": "simplifies access to node hash functions",
|
||||
"npmPackagename": "@pushrocks/smarthash",
|
||||
"license": "MIT"
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmAccessLevel": "public"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
825
package-lock.json
generated
825
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@pushrocks/smarthash",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.2",
|
||||
"private": false,
|
||||
"description": "simplifies access to node hash functions",
|
||||
"description": "simplified access to node hash functions",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
@ -14,6 +14,8 @@
|
||||
"url": "git+https://github.com/pushrocks/nodehash.git"
|
||||
},
|
||||
"keywords": [
|
||||
"pushrocks",
|
||||
"typescript",
|
||||
"hash",
|
||||
"node",
|
||||
"sha256",
|
||||
@ -27,15 +29,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/nodehash#readme",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tsrun": "^1.1.12",
|
||||
"@gitzone/tstest": "^1.0.15",
|
||||
"@gitzone/tsbuild": "^2.1.8",
|
||||
"@gitzone/tsrun": "^1.1.17",
|
||||
"@gitzone/tstest": "^1.0.18",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^10.9.4"
|
||||
"@types/node": "^10.12.19"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
"@types/through2": "^2.0.33",
|
||||
"through2": "^2.0.3"
|
||||
"@types/through2": "^2.0.34",
|
||||
"through2": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
17
tslint.json
Normal file
17
tslint.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||
"rules": {
|
||||
"semicolon": [true, "always"],
|
||||
"no-console": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"member-ordering": {
|
||||
"options":{
|
||||
"order": [
|
||||
"static-method"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
}
|
Reference in New Issue
Block a user