# typestub-ipfs-only-hash

> The type definition for ipfs-only-hash package

Latest version **4.0.0** (published 2021-05-03) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install typestub-ipfs-only-hash
pnpm add typestub-ipfs-only-hash
yarn add typestub-ipfs-only-hash
bun add typestub-ipfs-only-hash
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-05-03 |
| First published | 2021-05-03 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Beeno Tung |
| Maintainers | beenotung |
| Keywords | ipfs, ipfs-only-hash, types, typestub |

## Links

- npm: https://www.npmjs.com/package/typestub-ipfs-only-hash
- Repository: https://github.com/beenotung/typestub-ipfs-only-hash
- Homepage: https://github.com/beenotung/typestub-ipfs-only-hash#readme
- Issues: https://github.com/beenotung/typestub-ipfs-only-hash/issues
- npm.io page: https://npm.io/package/typestub-ipfs-only-hash

## Dependencies (1)

- [ipfs-only-hash](https://npm.io/package/ipfs-only-hash.md) ^4.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2021-05-03

## README

# typestub-ipfs-only-hash
[![npm Package Version](https://img.shields.io/npm/v/typestub-ipfs-only-hash.svg?maxAge=2592000)](https://www.npmjs.com/package/typestub-ipfs-only-hash)

Typescript declaration and wrapper for [ipfs-only-hash](https://github.com/alanshaw/ipfs-only-hash)

## Typescript Signature
```typescript
export function of (
  content: string | Buffer | Stream,
): Promise<string>
```

## Usage Example

Using namespace import
```typescript
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:
```typescript
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](./examples/index.ts)

---
_Source: https://npm.io/package/typestub-ipfs-only-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
