typestub-ipfs-only-hash
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

typestub-ipfs-only-hash

npm Package Version

Typescript declaration and wrapper for ipfs-only-hash

Typescript Signature

export function of (
  content: string | Buffer | Stream,
): Promise<string>

Usage Example

Using namespace import

import * as Hash from 'typestub-ipfs-only-hash'

;(async () => {
  const data = 'hello world!'
  const hash = await Hash.of(data)
  console.log(hash) // QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j
})()

Or using named import:

import { of } from 'typestub-ipfs-only-hash'

;(async () => {
  const data = 'hello world!'
  const hash = await of(data)
  console.log(hash) // QmTp2hEo8eXRp6wg7jXv1BLCMh5a4F3B7buAUZNZUu772j
})()

Details refer to examples

Package Sidebar

Install

npm i typestub-ipfs-only-hash

Weekly Downloads

7,334

Version

4.0.0

License

BSD-2-Clause

Unpacked Size

3.47 kB

Total Files

7

Last publish

Collaborators

  • beenotung