# gltf-content-hash

> Small library and command line utility for adding content hashes to images/bin chunks in glTF files.

Latest version **0.5.2** (published 2018-04-24) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install gltf-content-hash
pnpm add gltf-content-hash
yarn add gltf-content-hash
bun add gltf-content-hash
```

Provides the command `gltf-content-hash`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.2 |
| Published | 2018-04-24 |
| First published | 2018-03-30 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | robertlong |

## Links

- npm: https://www.npmjs.com/package/gltf-content-hash
- Repository: https://github.com/MozillaReality/gltf-content-hash
- npm.io page: https://npm.io/package/gltf-content-hash

## Dependencies (2)

- [fs-extra](https://npm.io/package/fs-extra.md) ^5.0.0
- [commander](https://npm.io/package/commander.md) ^2.15.0

## Recent versions

- 0.5.2 (latest) — 2018-04-24
- 0.5.1 — 2018-04-24
- 0.5.0 — 2018-04-24
- 0.4.0 — 2018-04-03
- 0.3.0 — 2018-03-31
- 0.2.0 — 2018-03-31
- 0.1.0 — 2018-03-30

## README

# gltf-content-hash

Small library and command line utility for adding content hashes to images/bin chunks in glTF files.

## Library Usage

```js
import path from "path";
import fs from "fs";
import { contentHashUrls } from "gltf-content-hash";

const gltfPath = path.join(__dirname, "mygltf.gltf");
const out = path.join(__dirname, "out");
const inGltf = JSON.parse(fs.readFileSync());

// Modifies uris in gltf and writes images to the output directory.
const { gltf, fileName } = await contentHashUrls(gltfPath, inGltf, { out });
```

## CLI Usage

```
npm install -g gltf-content-hash
```

```
Usage: gltf-content-hash <gltfPath> [options]

  Options:

    -V, --version    output the version number
    -r --rename      Rename the gltf file and images in-place.
    -o, --out <out>  The directory to output the modified glTF file and images. Defaults to the existing glTF path.
    -h, --help       output usage information
```

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