# hca-decoder

> HCA Decoder in Node.js

Latest version **1.6.0** (published 2024-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install hca-decoder
pnpm add hca-decoder
yarn add hca-decoder
bun add hca-decoder
```

## 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 | 1.6.0 |
| Published | 2024-03-04 |
| First published | 2018-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 108.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | toyobayashi |
| Maintainers | toyobayashi |
| Keywords | hca |

## Links

- npm: https://www.npmjs.com/package/hca-decoder
- Repository: https://github.com/toyobayashi/node-hca-decoder
- Homepage: https://github.com/toyobayashi/node-hca-decoder#readme
- Issues: https://github.com/toyobayashi/node-hca-decoder/issues
- npm.io page: https://npm.io/package/hca-decoder

## Dependencies (1)

- [node-addon-api](https://npm.io/package/node-addon-api.md) *

## Recent versions

- 1.6.0 (latest) — 2024-03-04
- 1.5.1 — 2021-07-26
- 1.5.0 — 2021-07-23
- 1.4.0 — 2021-07-22
- 1.3.1 — 2021-07-21
- 1.3.0 — 2021-07-21
- 1.2.0 — 2020-12-26
- 1.1.2 — 2020-12-26
- 1.1.1 — 2019-08-05
- 1.1.0 — 2019-08-05
- 1.0.2 — 2018-08-16
- 1.0.1 — 2018-06-11
- 1.0.0 — 2018-06-07

## README

# node-hca-decoder

[![Build status](https://api.travis-ci.com/toyobayashi/node-hca-decoder.svg?branch=master)](https://travis-ci.com/toyobayashi/node-hca-decoder)

HCA decoder based on [Nyagamon/HCADecoder](https://github.com/Nyagamon/HCADecoder)

## Usage

``` js
const { HCADecoder } = require('hca-decoder')
const hca = new HCADecoder(/* ciphKey1, ciphKey2 */)
const hcaInput = 'path/to/somefile.hca'
// or 
// const hcaInput = fs.readFileSync('path/to/somefile.hca')

hca.decodeToWaveFile(hcaInput/* , filenameWAV, volume, mode, loop, (err, wavFilePath) => {} */)
// => undefined (Async)

hca.decodeToWaveFileSync(hcaInput/* , filenameWAV, volume, mode, loop */)
// => boolean

hca.decodeToMemory(hcaInput/* , volume, mode, loop, (err, buffer) => {} */)
// => undefined (Async)

hca.decodeToMemorySync(hcaInput/* , volume, mode, loop */)
// => Buffer

hca.printInfo(hcaInput)
// => undefined

HCADecoder.getInfo(hcaInput)
// => HCAInfo
```

## Test

``` bash
# install node-gyp (5+)
$ npm install -g node-gyp

# tell npm use global node-gyp
$ npm config set node_gyp "`npm prefix -g`/lib/node_modules/node-gyp/bin/node-gyp.js"

# for Windows
# > for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"

# install node C++ header
$ node-gyp install # --target=<node version>

$ npm install # --no-package-lock

$ npm test
```

## License

* MIT

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