This repository was archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Awesome API Documentation #5
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ build/Release | |
node_modules | ||
|
||
dist | ||
docs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict' | ||
|
||
const multihashing = require('multihashing-async') | ||
const buf = new Buffer('beep boop') | ||
|
||
function print (err, mh) { | ||
if (err) { | ||
throw err | ||
} | ||
console.log(mh) | ||
} | ||
multihashing(buf, 'sha1', print) | ||
// => <Buffer 11 14 7c 83 57 57 7f 51 d4 f0 a8 d3 93 aa 1a aa fb 28 86 3d 94 21> | ||
|
||
multihashing(buf, 'sha2-256', print) | ||
// => <Buffer 12 20 90 ea 68 8e 27 5d 58 05 67 32 50 32 49 2b 59 7b c7 72 21 c6 24 93 e7 63 30 b8 5d dd a1 91 ef 7c> | ||
|
||
multihashing(buf, 'sha2-512', print) | ||
// => <Buffer 13 40 14 f3 01 f3 1b e2 43 f3 4c 56 68 93 78 83 77 1f a3 81 00 2f 1a aa 5f 31 b3 f7 8e 50 0b 66 ff 2f 4f 8e a5 e3 c9 f5 a6 1b d0 73 e2 45 2c 48 04 84 b0 ...> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,10 @@ | |
"test:browser": "aegir-test browser", | ||
"test:node": "aegir-test node", | ||
"lint": "aegir-lint", | ||
"release": "aegir-release", | ||
"release-minor": "aegir-release minor", | ||
"release-major": "aegir-release major", | ||
"docs": "aegir-docs", | ||
"release": "aegir-release --docs", | ||
"release-minor": "aegir-release minor --docs", | ||
"release-major": "aegir-release major --docs", | ||
"build": "aegir-build", | ||
"coverage": "aegir-coverage", | ||
"coverage-publish": "aegir-coverage publish", | ||
|
@@ -42,10 +43,10 @@ | |
"nodeify": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^9.1.2", | ||
"aegir": "^9.3.0", | ||
"benchmark": "^2.1.2", | ||
"chai": "^3.5.0", | ||
"pre-commit": "^1.1.3" | ||
"pre-commit": "^1.2.2" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
|
@@ -60,4 +61,4 @@ | |
"Richard Littauer <[email protected]>", | ||
"npm-to-cdn-bot (by Forbes Lindesay) <[email protected]>" | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this looks weird, func should be number or string. Reason would be because we change the argument orders if there are optional arguments. However, I can see this being confusing. Any ideas on how we can make it better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand, is your issue the name
func
, because the definition I wrote isnumber
orstring
.